> I have discovered a bug in the handling of hi files in the 
> presence of 
> -fglasgow-exts.  Below is a module, MyModule.hs, which uses 
> Word internally 
> but exports a function of type Integer->Integer.  There is 
> also a Main.hs 
> module which uses this function, but of course does not 
> import Word since it 
> doesn't need to.
> 
> Under ghc-3.02 I get the expected behaviour: I give 
> -fglasgow-exts when 
> compiling MyModule.hs, but not when compiling Main.hs.  I do, 
> however, need to 
> give -fglasgow-exts when linking.
> 
> Under ghc-4.01 (well, the head of the CVS tree as of 
> yesterday), however, I 
> need to give -fglasgow-exts when compiling Main.hs, too.  
> This is surely wrong!

Thanks for the report, but I think GHC is behaving as expected here.  

Compiling with -fglasgow-exts gives you access to the extended libraries,
and if you compile one module with -fglasgow-exts you can reasonably expect
to have to compile any modules that refer to it with -fglasgow-exts too.
This probably needs documenting somewhere.

The low-level reason in this case was that the interface file recorded that
Word contained some instances, and effectively re-exported them from
MyModule.hs.

I'm not sure why it went through with 3.02, that needs more investigation.
However, 3.03 behaves the same as 4.01.

Cheers,
        Simon

-- 
Simon Marlow 
Microsoft Research Ltd., Cambridge, U.K.

Reply via email to