Splitting SYB from the base package in GHC 6.10

Bart Massey bart at cs.pdx.edu
Tue Sep 2 11:59:49 EDT 2008


Ian Lynagh <igloo <at> earth.li> writes:
> * You want to use a different instance for the same type.
> 
>   Instances are global in Haskell, so if one library needs Ratio instance 1,
>   and another library needs Ratio instance 2, then those libraries cannot be
>   used in the same program.

For me it's not so much about the libraries.  I've run into cases (not in SYB)
where I want my program to use a different definition of an instance than the
one provided by a library, while still using the other stuff provided by that
library.

The pervasive globality of instances does seem to me to be a Haskell bug; it
seems to me like they ought to be controlled using the same module export
control rules as anything else.  But I imagine there's some reason I don't
understand that makes this hard or impossible...



More information about the Libraries mailing list