instance visibility (was: Re: The base library and GHC 6.10)

Ian Lynagh igloo at
Wed Sep 24 13:38:35 EDT 2008

On Wed, Sep 24, 2008 at 05:30:27PM +0100, Claus Reinke wrote:
> What one cannot do (in Haskell 98) is to have two instances of
> the same class, for the same types, in the same import hierarchy.

What do you mean by "in the same import hierarchy"?
Do you mean "in the same program"?

I've put an example showing how multiple instances can cause Data.Set to
go wrong here:

Do you think that that behaviour is OK?

> >This is even worse at the level of packages.
> How do packages make a difference here?

Generally, you control what other modules in your program do, but not
what the packages that you depend on do. So if a package you use starts
using an instance that you don't want, then you are stuck.


More information about the Libraries mailing list