[GHC] #8622: Importing modules in .ghci file doesn't work
GHC
ghc-devs at haskell.org
Fri Jan 3 17:29:50 UTC 2014
#8622: Importing modules in .ghci file doesn't work
---------------------------------+----------------------------------
Reporter: m4dc4p | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: GHCi | Version: 7.6.3
Resolution: | Keywords:
Operating System: MacOS X | Architecture: x86_64 (amd64)
Type of failure: None/Unknown | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets:
---------------------------------+----------------------------------
Changes (by simonpj):
* cc: simonmar (added)
Comment:
Actually this is by design. You can only use `import` and `:module` for a
module that either
* is already loaded as part of the current program (`:show modules` tells
you which ones are, I think), or
* is a module of a visible package
If you use `:load Macros` rather than `import Macros`, all is well.
However, the [http://www.haskell.org/ghc/docs/latest/html/users_guide
/interactive-evaluation.html user documentation] is not good on this
point. Notably, it says (2.4.5.1) that "You cannot add a module to the
scope if it is not loaded". But that's not true: you can also add (or
`import`) any package module.
Copying Simon M to check my statements here. If correct, I'll update the
documentation.
Simion
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8622#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list