HUGS(1)

NAME
hugs - Hugs 98, functional programming system

SYNOPSIS
hugs [ options ] [ modules ]

DESCRIPTION
Hugs is an interpreter for Haskell, a standard non-strict functional programming language. Hugs implements almost all of the Haskell 98 standard, except for mutually recursive modules. The name Hugs is a mnemonic for the Haskell User's Gofer System.

The interpreter is started using the hugs command. After processing options, it loads the standard module Prelude and any other modules listed on the command line.

Each Haskell module is stored in a separate file. When loading a module name, Hugs looks in each of the directories on its search path (see -P under OPTIONS) for the files name, name.hs and name.lhs. Files ending in ".lhs" are treated as literate scripts.

Once the interpreter has been loaded, the following commands are available:

:load [modules]
    clear all modules except the prelude, and load the specified modules.

:also modules
    read additional modules.

:reload
    repeat last load command.

:project file
    load the modules listed in file, which contains module names separated by whitespace, possibly with Haskell-style comments.

:edit file
    edit file.

:edit
    edit last file.

:module module
    set module for evaluating expressions.

expr
    evaluate expression.

:type expr
    print type of expression.

:?  display this list of commands.

:set options
    set command line options.

:set
    help on command line options.

:names [patterns]
    list names currently in scope matching any of the shell-style patterns.

:info names
    describe named objects.

:browse modules
    browse names defined in modules.

:find name
    edit file containing definition of name.

:!command
    shell escape.

:cd dir
    change directory.

:gc force garbage collection.

:version
    print Hugs version.

:quit
    exit Hugs interpreter.

Any command may be abbreviated to :c where c is the first character in the full name. On most systems, you can also exit from Hugs by typing the end-of-file character (^D).

Note that the interrupt key (^C on most systems) can be used at any time whilst using Hugs to abandon the process of reading in a file of function definitions or the evaluation of an expression. When the interrupt key is detected, Hugs prints the string "{Interrupted!}" and prints the prompt so that further commands can be entered.

OPTIONS
One group of options are toggled with + or - to turn them on or off, respectively:

+98 Accept only Haskell 98 (cannot be changed within Hugs; default: on). Turning this off enables several special Hugs extensions, which are described in the Hugs 98 User Manual.

+s  Print number of reductions/cells after each evaluation (default: off)

+t  Print type after each evaluation (default: off)

+f  Terminate evaluation on first error (default: on)

+g  Print number of cells recovered after gc (default: off)

+l  Literate scripts as default (default: off)

+e  Warn about errors in literate scripts (default: on)

+.  Print dots to show progress while loading modules (default: off)

+q  Print nothing to show progress while loading modules (default: off)

+Q  Qualify names when printing (default: off)

+w  Always show which files loaded (default: on)

+k  Show kind errors in full (default: off)

+u  Use "show" to display results (default: on)

+i  Chase imports while loading files (default: on)

+o  Allow overlapping instances (a Hugs extension; default: off)

+m  Use multi instance resolution (a Hugs extension; default: off)

Other options (in which - could be replaced by +, the choice making no difference) are:

-hnum
    Set heap size (cannot be changed within Hugs; default: 250K)

-pstr
    Set prompt string to str (default: `%s> '). Any %s in the prompt will be replaced by the current module name.

-rstr
    Set repeat last expression string to str (default: $$).

-Pstr
    Set search path for source files to str, which should be a colon-separated list of directories. A null entry in this list will be replaced by the previous search path. Any occurrence of {Hugs} in this string is expanded to the Hugs library directory, namely /usr/local/share/hugs. The default value is

    {Hugs}/lib:{Hugs}/lib/hugs:{Hugs}/lib/exts

-Estr
    Use editor setting given by str (unset by default). Any occurrences of %d and %s in the editor option are replaced by the start line number and the name of the file to be edited, respectively. A common setting is "vi +%d %s".

-cnum
    Set constraint cutoff limit in the type checker to num (default: 40).

-Fcmd
    Set preprocessor filter for source files to cmd (unset by default). Instead of reading a source file directly, Hugs will read the standard output of cmd run with the source file name as argument.

ENVIRONMENT

HUGSFLAGS
    Additional options for hugs, processed before any given on the command line.

EDITOR
    The default editor, if -E is not given.

SHELL
    Used to specify shell that is invoked by the :! command.

FILES

/usr/local/bin/hugs
    executable binary.

/usr/local/share/hugs
    directory containing support files.

/usr/local/share/hugs/lib/Prelude.hs
    standard prelude, loaded when hugs starts.

WEB REFERENCES

http://www.haskell.org/hugs/
    The Hugs home page.

http://www.haskell.org/
    The Haskell home page, including the language definition, various mailing lists and much more.

SEE ALSO
Mark P. Jones et al. Hugs 98 User Manual, June 1999.

S. Peyton Jones and J. Hughes (editors). Report on the Programming Language Haskell 98, A Non-strict Purely Functional Language. February 1999.

Paul Hudak & Joseph H. Fasel. A gentle introduction to Haskell. ACM SIGPLAN Notices, 27(5), May 1992.

AUTHOR
Hugs 98: Mark Jones and others, June 1999.

Manual page: Jonathan Bowen, modified by Gary Leavens, and then (with apologies to the original authors) by Mark Jones. Updated for Hugs 98 by Antti-Juhani Kaijanaho and Ross Paterson.