This repository was archived by the owner on Nov 6, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathjeroen.1
274 lines (260 loc) · 4.45 KB
/
jeroen.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
.TH GOFER 1
.SH NAME
gofer \- Functional programming language
.br
gofc \- Gofer-to-C compiler
.br
gofcc \- Compile C program generated by gofc
.SH SYNOPSIS
gofer [options] [files]
.br
gofc [options] [files]
.br
gofcc
.RI file .c
.SH FILE PARAMETERS
File parameters can be of three types:
.br
.TP 1c
Gofer scripts
File containing definitions of functions,
operators, types, etc.
Comments are enclosed by
.B {\-
and
.B \-}
or by
.B \-\-
and end-of-line.
Files ending in
.IR .hs ,
.IR .has ,
.IR .gs ,
.I .gof
and
.I .prelude
are always treated as Gofer scripts.
.TP
Literate scripts
File in which everything is comment except lines that start
with a
.B >
symbol.
Files ending in
.IR .lhs ,
.IR .lgs ,
.I .verb
and
.I .lit
are always treated as literate scripts.
.TP
Project files
File containing names of files and options that
are used as parameter to Gofer.
Project filenames should be preceded by a
.B +
symbol
and a space.
.PP
Filenames that cannot be classified according to their
suffix are treated as Gofer script, or as
literate script if the
.I +l
option is used (see below).
.SH OPTIONS
Below is a list of toggles that can be switched
on by
.BI + letter
or off by
.BI \- letter.
In the list the
default settings are shown.
.PD 0
.sp
.TP 1c
+s
Print number of reductions/cells after evaluation
.TP
\-t
Print type after evaluation
.TP
\-d
Show dictionary values in output expressions
.TP
+f
Terminate evaluation on first error
.TP
\-g
Print number of recovered cells after garbage collection
.TP
+c
Test conformality for pattern bindings
.TP
\-l
Literate scripts as default
.TP
+e
Warn about errors in literate scripts
.TP
\-i
Apply
.I fromInteger
to integer literals
.TP
+o
Optimise use of
.B (&&)
and
.B (||)
.TP
\-u
Catch ambiguously typed top-level variables
.TP
\-.
Print dots during file analysis
.TP
+w
Always show which files are loaded
.TP
+1
Overload singleton list notation
.TP
\-k
Show `kind'-errors in full
.sp
.PP
Other options are:
.sp
.TP 12
.RI \-h number
Set heap size in cells (default 100000)
.TP
.RI \-p string
Set prompt string (default ?)
.TP
.RI \-r string
Set `repeat last expression' string (default $$)
.PD
.SH COMMANDS
Commands that can be typed to the interpreter are:
.PD 0.2v
.sp
.TP 20
.I expression
Evaluate expression
.TP
.B :quit
Quit interpreter
.TP
.B :?
Display this list of commands
.TP
.BI :load " files"
Load scrips from specified files
.TP
.BI :also " files"
Read additional files
.TP
.BI :project " file"
Use project file
.TP
.BI :edit " file"
Edit file and reload if necessary
.TP
.BI :type " expression"
Print type of expression
.TP
.BI :set " options"
Set options (as in commandline)
.TP
.BI :info " names"
Describe named functions, types etc.
.TP
.BI :find " name"
Edit file containing definition of
.I name
.TP
.BI :names " pattern"
List names currently in scope
.TP
.BI ! command
Shell escape
.TP
.BI :cd " directory"
Change working directory
.PD
.SH COMPILER
Gofer programs can be compiled using
.BR gofc .
One of the scripts should contain a definition
for a function
.I main
of type
.I Dialogue.
If you don't know what a `Dialogue' is, you can use
the definition
.IP "" 2cm
main = interact f
.PP
where f is a function f::String\->String.
.B gofc
generates a C program, using the last filename
with
.I .c
appended.
The generated C program can be compiled and linked with
.BR gofcc ,
which generates
.IR a.out .
.SH ENVIRONMENT VARIABLES
.TP 3cm
GOFER
Name of standard prelude (script that is always loaded before
all user files)
.TP
EDITOR
Name of the editor to be used by the
.B :edit
command
.TP
EDITLINE
Description how the editor can be called
with specified linenumber and filename,
e.g.
.BR "vi +%d %s" .
.SH FILES
.PD 0.2v
.TP 36
/usr/gofer-2.28/lib/standard.prelude
Standard prelude
.TP
/usr/gofer-2.28/lib/*.prelude
Alternative preludes
.TP
/usr/gofer-2.28/lib/demos/*
Example programs
.TP
/usr/gofer-2.28/lib/runtime.o
Runtime system linked by gofcc
.TP
/usr/gofer-2.28/include/*.h
Files included by gofcc
.TP
/usr/gofer-2.28/doc/*
User manuals (LaTeX-source)
.PD
.SH AUTHOR
Mark P. Jones
.SH VERSION
Gofer version 2.28b of May 18, 1993.
.SH LITERATURE
Mark P. Jones: Introduction to Gofer 2.20
.br
Mark P. Jones: Gofer 2.23 release notes
.br
Mark P. Jones: Gofer 2.28 release notes
.br
R. Bird & P.Wadler: Introduction to functional programming
.br
Paul Hudak & Joseph Fasel: `A gentle introduction to Haskell',
ACM Sigplan notices 27:5.