Starting Hugs
On Unix machines, the Hugs interpreter is usually started with a
command line of the form:
hugs [option | file] ...
On Windows 95/NT, Hugs may be started by selecting it from the
start menu or by double clicking on a file with the
.hs or .lhs extension.
(This manual assumes that Hugs has already been successfully
installed on your system.)
Hugs uses options to set system parameters. These options are
distinguished by a leading + or - and are
used to customize the behaviour of the interpreter.
When Hugs starts, the interpreter
performs the following tasks:
- Options in the environment are processed. The variable
HUGSFLAGS holds these options. On Windows 95/NT, the registry is
queried if HUGSFLAGS is undefined.
- Command line options are processed.
- Internal data structures are initialized. In
particular, the heap is initialized, and its size is
fixed at this point; if you want to run the interpreter with a heap
size other than the default, then this must be specified using
options on the command line, in the environment or in the registry.
- The prelude file is loaded. The interpreter will
look for the prelude file on the path specified by
the -P option. If the prelude, located in the file
Prelude.hs, cannot be found in one of the path directories or
in the current directory, then Hugs will terminate;
Hugs will not run without the prelude file.
- Program files specified on the command line are loaded. The
effect of a command hugs f1 ... fn is the same as starting up
Hugs with the hugs command and then typing :load f1 ... fn.
In particular, the interpreter will not terminate if a problem occurs
while it is trying to load one of the specified files, but it will
abort the attempted load command.
The environment variables and command line options used by Hugs are
described in the following sections.
Environment options
Options