Download The Glorious Glasgow Haskell Compilation System User`s Guide

Transcript
Using GHCi
:reload
Attempts to reload the current target set (see :load) if any of the modules in the
set, or any dependent module, has changed. Note that this may entail loading new
modules, or dropping modules which are no longer indirectly required by the target.
:set
[option...]
Sets various options. See Section 3.7, “The :set command” for a list of available
options. The :set command by itself shows which options are currently set.
:set args arg
...
Sets the list of arguments which are returned when the program calls System.getArgs.
:set editor
cmd
:set prog
prog
:set prompt
prompt
Sets the command used by :edit to cmd.
:show bindings
:show modules
:ctags [filename] :etags
[filename]
Show the bindings made at the prompt and their types.
Sets the string to be returned when the program calls System.getProgName.
Sets the string to be used as the prompt in GHCi. Inside prompt, the sequence %s
is replaced by the names of the modules currently in scope, and %% is replaced by %.
Show the list of modules currently load.
Generates a “tags” file for Vi-style editors (:ctags) or Emacs-style editors
(etags). If no filename is specified, the defaulit tags or TAGS is used, respectively. Tags for all the functions, constructors and types in the currently loaded modules are created. All modules must be interpreted for these commands to work.
See also Section 10.1, “Ctags and Etags for Haskell: hasktags”.
:type expression
Infers and prints the type of expression, including explicit forall quantifiers for
polymorphic types. The monomorphism restriction is not applied to the expression
during type inference.
:kind type
Infers and prints the kind of type. The latter can be an arbitrary type expression,
including a partial application of a type constructor, such as Either Int.
:undef name
Undefines the user-defined command name (see :def above).
:unset option...
Unsets certain options. See Section 3.7, “The :set command” for a list of available options.
:! command...
Executes the shell command command.
3.7. The :set command
The :set command sets two types of options: GHCi options, which begin with ‘+” and
“command-line” options, which begin with ‘-’.
NOTE: at the moment, the :set command doesn't support any kind of quoting in its arguments: quotes
will not be removed and cannot be used to group words together. For example, :set -DFOO='BAR
BAZ' will not do what you expect.
3.7.1. GHCi options
GHCi options may be set using :set and unset using :unset.
The available GHCi options are:
38