GOFER(1)

NAME
gofer - Functional programming language
gofc - Gofer-to-C compiler
gofcc - Compile C program generated by gofc

SYNOPSIS
gofer [options] [files]
gofc [options] [files]
gofcc file.c

FILE PARAMETERS
File parameters can be of three types:

Gofer scripts
    File containing definitions of functions, operators, types, etc. Comments are enclosed by {- and -} or by -- and end-of-line. Files ending in .hs, .has, .gs, .gof and .prelude are always treated as Gofer scripts.

Literate scripts
    File in which everything is comment except lines that start with a > symbol. Files ending in .lhs, .lgs, .verb and .lit are always treated as literate scripts.

Project files
    File containing names of files and options that are used as parameter to Gofer. Project filenames should be preceded by a + symbol and a space.

Filenames that cannot be classified according to their suffix are treated as Gofer script, or as literate script if the +l option is used (see below).

OPTIONS
Below is a list of toggles that can be switched on by +letter or off by -letter. In the list the default settings are shown.

+s  Print number of reductions/cells after evaluation
-t  Print type after evaluation
-d  Show dictionary values in output expressions
+f  Terminate evaluation on first error
-g  Print number of recovered cells after garbage collection
+c  Test conformality for pattern bindings
-l  Literate scripts as default
+e  Warn about errors in literate scripts
-i  Apply fromInteger to integer literals
+o  Optimise use of (&&) and (||)
-u  Catch ambiguously typed top-level variables
-.  Print dots during file analysis
+w  Always show which files are loaded
+1  Overload singleton list notation
-k  Show `kind'-errors in full

Other options are:

-hnumber
    Set heap size in cells (default 100000)
-pstring
    Set prompt string (default ?)
-rstring
    Set `repeat last expression' string (default $$)

COMMANDS
Commands that can be typed to the interpreter are:

expression
    Evaluate expression

:quit
    Quit interpreter

:?  Display this list of commands

:load files
    Load scrips from specified files

:also files
    Read additional files

:project file
    Use project file

:edit file
    Edit file and reload if necessary

:type expression
    Print type of expression

:set options
    Set options (as in commandline)

:info names
    Describe named functions, types etc.

:find name
    Edit file containing definition of name

:names pattern
    List names currently in scope

!command
    Shell escape

:cd directory
    Change working directory

COMPILER
Gofer programs can be compiled using gofc. One of the scripts should contain a definition for a function main of type Dialogue. If you don't know what a `Dialogue' is, you can use the definition

    main = interact f

where f is a function f::String->String. gofc generates a C program, using the last filename with .c appended. The generated C program can be compiled and linked with gofcc, which generates a.out.

ENVIRONMENT VARIABLES

GOFER
    Name of standard prelude (script that is always loaded before all user files)

EDITOR
    Name of the editor to be used by the :edit command

EDITLINE
    Description how the editor can be called with specified linenumber and filename, e.g. vi +%d %s.

FILES

/usr/gofer-2.28/lib/standard.prelude
    Standard prelude

/usr/gofer-2.28/lib/*.prelude
    Alternative preludes

/usr/gofer-2.28/lib/demos/*
    Example programs

/usr/gofer-2.28/lib/runtime.o
    Runtime system linked by gofcc

/usr/gofer-2.28/include/*.h
    Files included by gofcc

/usr/gofer-2.28/doc/*
    User manuals (LaTeX-source)

AUTHOR
Mark P. Jones

VERSION
Gofer version 2.28b of May 18, 1993.

LITERATURE
Mark P. Jones: Introduction to Gofer 2.20
Mark P. Jones: Gofer 2.23 release notes
Mark P. Jones: Gofer 2.28 release notes
R. Bird & P.Wadler: Introduction to functional programming
Paul Hudak & Joseph Fasel: `A gentle introduction to Haskell', ACM Sigplan notices 27:5.