Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
087fc5a7
Commit
087fc5a7
authored
Jul 11, 2008
by
Simon Marlow
Browse files
#2371: try to explain the difference between :module and :load
parent
d292dd0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
docs/users_guide/ghci.xml
View file @
087fc5a7
...
...
@@ -615,6 +615,41 @@ Prelude IO>
then GHCi will expand it to
“
<literal>
Just
</literal>
”
.
</para>
<sect3>
<title><literal>
:module
</literal>
and
<literal>
:load
</literal></title>
<para>
It might seem that
<literal>
:module
</literal>
and
<literal>
:load
</literal>
do similar things: you can use both
to bring a module into scope. However, there is a clear
difference. GHCi is concerned with two sets of modules:
</para>
<itemizedlist>
<listitem>
<para>
The set of modules that are
currently
<emphasis>
loaded
</emphasis>
. This set is
modified
by
<literal>
:load
</literal>
,
<literal>
:add
</literal>
and
<literal>
:reload
</literal>
.
</para>
</listitem>
<listitem>
<para>
The set of modules that are currently
<emphasis>
in
scope
</emphasis>
at the prompt. This set is modified
by
<literal>
:module
</literal>
, and it is also set
automatically
after
<literal>
:load
</literal>
,
<literal>
:add
</literal>
,
and
<literal>
:reload
</literal>
.
</para>
</listitem>
</itemizedlist>
<para>
You cannot add a module to the scope if it is not
loaded. This is why trying to
use
<literal>
:module
</literal>
to load a new module results
in the message
“
<literal>
module M is not
loaded
</literal>
”
.
</para>
</sect3>
<sect3>
<title>
Qualified names
</title>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment