I don't know how to do what you want, but you can fake it like this:
- First use
:load My/Module.hs to load your module. - Use
:module - My.Module to get it out of scope. - (Optional.) Use
import qualified My.Module as MM to bring it into scope.
Each module that GHCi knows about is automatically fully accessible, so after step 2 My.Module.value will work fine. Step 3 is only necessary if you want to use a shorter prefix.
If you want to load several files at once :load can do it too
:load My/Module1.hs My/Module2.hs ... My/ModuleN.hs
will work fine. It will put you in the *My.Module1 , and then My.Module2 ... My.ModuleN will be fully accessible, as described above.
For more information on GHCi, you can always check the GHC User Guide, chap. 2: "Use of GHCi" ; especially the relevant sections of Β§2.2, "Downloading Source Files" and Β§2.4.5, "What is really in the prompt area?" .
Antal spector-zabusky
source share