From 087fc5a777f18ef6fa488d168cdf18ef8a22f374 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Fri, 11 Jul 2008 12:00:46 +0000 Subject: [PATCH] #2371: try to explain the difference between :module and :load --- docs/users_guide/ghci.xml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) 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 -- 1.7.10.4