I encounter a strange situation in GHCI, don't know if anyone observed similar case. For some module, when I have it in the search path both by -package-conf
, and also by -i
, GHCI fails when I try to import the module with 'module is not loaded: FooModule'
.
:module
loads it fine however:load FooModule
, :m
to clear the import list, and then import FooModule
-i
and then it imports fineTracked this to be the otherwise -> modNotLoadedError m loc
case in GHC, where otherwise
~ modulePackageId = this_pkg
(the meaning of which I don't know).
This is not entirely systematic, there are some module which are both in package and source path, but can be imported.
GHC only knows about packages that are installed. To see which packages are installed, use the ghc-pkg list command:
$ ghc-pkg list /usr/lib/ghc-6.12.1/package.conf.d: Cabal-1.7.4 array-0.2.0.1 base-3.0.3.0 base-4.2.0.0 bin-package-db-0.0.0.0 binary-0.5.0.1 bytestring-0.9.1.4 containers-0.2.0.1 directory-1.0.0.2 (dph-base-0.4.0) (dph-par-0.4.0) (dph-prim-interface-0.4.0) (dph-prim-par-0.4.0) (dph-prim-seq-0.4.0) (dph-seq-0.4.0) extensible-exceptions-0.1.1.0 ffi-1.0 filepath-1.1.0.1 (ghc-6.12.1) ghc-prim-0.1.0.0 haskeline-0.6.2 haskell98-1.0.1.0 hpc-0.5.0.2 integer-gmp-0.1.0.0 mtl-1.1.0.2 old-locale-1.0.0.1 old-time-1.0.0.1 pretty-1.0.1.0 process-1.0.1.1 random-1.0.0.1 rts-1.0 syb-0.1.0.0 template-haskell-2.4.0.0 terminfo-0.3.1 time-1.1.4 unix-2.3.1.0 utf8-string-0.3.4
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With