Separate compilation fails with existential records
Consider M.hs:
> {-# OPTIONS_GHC -fglasgow-exts #-}
> module M where data D = forall a. C { l :: a }
Then consider Main.hs:
> import M
> main = print () where x = C { l = () }
A normal compilation works:
$ ghc --make Main.hs
[1 of 2] Compiling M ( M.hs, M.o )
[2 of 2] Compiling Main ( Main.hs, Main.o )
Linking Main ...
However, separate compilation does not:
$ touch Main.hs
$ ghc --make Main.hs
[2 of 2] Compiling Main ( Main.hs, Main.o )
Main.hs:2:26:
Constructor `C' does not have field `l'
In the expression: C {l = ()}
In the definition of `x': x = C {l = ()}
In the definition of `main':
main = print ()
where
x = C {l = ()}
Where should I start looking to fix this? :-)
Thanks, Audrey