
I have module Powser stored in haskell/Powser.hs. There is no file ./Powser*. This loads the module shellprompt> ghci -ihaskell Prelude> :load Powser But this can't find it shellprompt> ghci -ihaskell Prelude> import Powser What might cause the difference? (I am running ghci 7.8.4.) Doug

I'm a true beginner, so maybe what I say is false or useless, but from the
few I know, I think the statement "import" is asking for the name of a
module, not just the name of a file. So, is your file starting with the
module declaration statement "module Powser (...) where" ?
Le mardi 19 avril 2016, Doug McIlroy
I have module Powser stored in haskell/Powser.hs. There is no file ./Powser*.
This loads the module shellprompt> ghci -ihaskell Prelude> :load Powser But this can't find it shellprompt> ghci -ihaskell Prelude> import Powser
What might cause the difference? (I am running ghci 7.8.4.)
Doug _______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners

interesting. I just found this: https://downloads.haskell.org/~ghc/7.8.4/docs/html/users_guide/interactive-e... 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”.

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
interesting. I just found this:
https://downloads.haskell.org/~ghc/7.8.4/docs/html/users_guide/interactive-e...
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”.
participants (3)
-
Doug McIlroy
-
Imants Cekusins
-
Silent Leaf