[Haskell-beginners] GHCI: Main function seems to mask other functions

Daniel Fischer daniel.is.fischer at web.de
Tue May 5 10:42:06 EDT 2009


Am Dienstag 05 Mai 2009 15:11:23 schrieb aditya siram:
> Hi all,
> I'm having a weird problem where when I add the 'main' function to my
> program and load it into GHCI, whenever I check the type or try to run my
> other functions I get a 'Not in scope: <functionname>' error.  When I
> remove the 'main' function and reload the code, the problem goes away.
>
> I can't seem to reproduce this with a trivial example, but this has
> happened to me several times in my larger programs.
>
> thanks ...
> deech

Odd. Does it happen with the module header

module Main where

, with an explicit export list, or without any module header?

Is it so that with the main function, you load the compiled function, then when you get 
the Not in scope, you remove the main function and reload the module without compiling?
Then it's probably the correct behaviour, cf. the user's guide, section 3.4.3. What's 
really in scope at the prompt?



More information about the Beginners mailing list