[Haskell] class instance lost during re-export & packaging
simonmarhaskell at gmail.com
Tue Feb 13 08:05:35 EST 2007
Conal Elliott wrote:
> I have a package P that contains a class instance specified in one
> module P.M and re-exported in packaging module P (one that gathers &
> re-exports for the whole P package). When I import the package module P
> in a test module, Under ghc-6.6, my instance is not found. If the test
> module also says "import P.M()", the instance is found. Oddly, I only
> have this problem with classes defined in a package other than P.
That sounds like a bug. It might be an instance of the last bullet point here:
but I suggest you open a ticket for it and we'll check.
> In ghci, after loading the module successfully, if I comment out the
> "import P.M()" and re-load, the instance is found.
This one is definitely an instance of the known bug above. GHCi just keeps
collecting instances from packages and never throws any away.
More information about the Haskell