From: Simon Marlow Date: Fri, 11 Jul 2008 12:00:46 +0000 (+0000) Subject: #2371: try to explain the difference between :module and :load X-Git-Tag: Before_cabalised-GHC~23 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=087fc5a777f18ef6fa488d168cdf18ef8a22f374 #2371: try to explain the difference between :module and :load --- diff --git a/docs/users_guide/ghci.xml b/docs/users_guide/ghci.xml index c5b5f7c..299b1e5 100644 --- a/docs/users_guide/ghci.xml +++ b/docs/users_guide/ghci.xml @@ -616,6 +616,41 @@ Prelude IO> + <literal>:module</literal> and + <literal>:load</literal> + + It might seem that :module and + :load 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: + + + + The set of modules that are + currently loaded. This set is + modified + by :load, :add + and :reload. + + + + The set of modules that are currently in + scope at the prompt. This set is modified + by :module, and it is also set + automatically + after :load, :add, + and :reload. + + + + You cannot add a module to the scope if it is not + loaded. This is why trying to + use :module to load a new module results + in the message “module M is not + loaded”. + + + Qualified names To make life slightly easier, the GHCi prompt also