Claus Reinke wrote:
most of us would be happy if instance contexts
would be required to uniquely determine the instance to be
chosen, a rather conservative extension of current practice.

How would that work? There's no way to prove that

    instance (Num a) => Foo a where ...
    instance Foo Char where ...

don't overlap, because there's no way to know what instances of Num might be declared in other modules. If you reason based on what's in scope, you end up with the same problems that Simon detailed for overlapping instances. I can't think of any situation where the context could safely be used to resolve overlap except for a class private to the current module whose instances are locally constrained, but that doesn't seem like it would be very useful.

-- Ben

_______________________________________________
Haskell-prime mailing list
Haskell-prime@haskell.org
http://haskell.org/mailman/listinfo/haskell-prime

Reply via email to