[Haskell-beginners] ghci :load vs import

Silent Leaf silent.leaf0 at gmail.com
Tue Apr 19 20:00:07 UTC 2016


Interesting indeed. Logical too, in my personal view, since otherwise, to
merely import a module could have triggered an unwanted, unpredictable
(re)compilation of some other file.
One must be able to control this, it seems fitting the internal statement
"import" doesn't have such an external effect of (re)compilation of other
modules, it's definitely not its role nor "right" in my view.

Le mardi 19 avril 2016, Imants Cekusins <imantc at gmail.com> a écrit :
> interesting. I just found this:
>
https://downloads.haskell.org/~ghc/7.8.4/docs/html/users_guide/interactive-evaluation.html#ghci-import-decl
> 2.4.5.5. :module and :load
> ...
> You can add a module to the scope (via :module or import) only if either
(a) it is loaded, or (b) it is a module from a package that GHCi knows
about. Using :module or import to try bring into scope a non-loaded module
may result in the message “module M is not loaded”.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20160419/54fb6046/attachment.html>


More information about the Beginners mailing list