logo       

RE: special handling of "Main.hs" contradicts Report: msg#00047

lang.haskell.glasgow.bugs

Subject: RE: special handling of "Main.hs" contradicts Report


> 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


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise