Commit 087fc5a7 authored by Simon Marlow's avatar Simon Marlow

#2371: try to explain the difference between :module and :load

parent d292dd0a
......@@ -615,6 +615,41 @@ Prelude IO>
then GHCi will expand it to &ldquo;<literal>Just </literal>&rdquo;.
<title><literal>:module</literal> and
<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>
<para>The set of modules that are
currently <emphasis>loaded</emphasis>. This set is
by <literal>:load</literal>, <literal>:add</literal>
and <literal>:reload</literal>.
<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
after <literal>:load</literal>, <literal>:add</literal>,
and <literal>:reload</literal>.</para>
<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 &ldquo;<literal>module M is not
<title>Qualified names</title>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment