special handling of "Main.hs" contradicts Report
Simon Marlow
simonmar at microsoft.com
Fri Apr 18 04:55:55 EDT 2003
> I have this simple module:
>
> module X where
> t1 = t1
>
> If it's in a file called "X.hs," all works as expected,
> it exports 't1'. But if it's in a file called "Main.hs,"
> then it doesn't export 't1'.
Nope, I can't reproduce that:
Prelude> :!cat Main.hs
module X where
t1 = t1
Prelude> :l Main.hs
Compiling X ( Main.hs, interpreted )
Ok, modules loaded: X.
*X> :b X
t1 :: forall t. t
*X>
> The same is true if we have "module Main" instead of "module X".
Hmm, there might be a bug here. I always thought that if you write 'module Main where' as the module header, then the compiler is
allowed to interpret it as 'module Main (main) where', but I just checked the report and it doesn't seem to say that (perhaps it was
an older version of Haskell? Anyone remember?).
Cheers,
Simon
More information about the Glasgow-haskell-bugs
mailing list