GHCI: Main function seems to mask other functions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

GHCI: Main function seems to mask other functions

aditya siram-2
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20090505/f05a2b69/attachment.htm
Reply | Threaded
Open this post in threaded view
|

GHCI: Main function seems to mask other functions

Daniel Fischer-4
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?