On March 3, 2010 21:10:56 Daniel Fischer wrote:
> Well, GHC takes only the class head into account for instance selection,
> and
>
> u -> (v -> w)
>
> matches both,
>
> a -> b   --  (a == u, b == v -> w)
>
> and
>
> m (c -> d)    -- (m == ((->) u), c == v, d == w),
>
> ... <snip> ...
>
> are indeed conflicting, so you can't even use OverlappingInstances etc. to
> make it work.

Thanks very much for the explanation.  I had only read 7.7 (Type families) 
from the GHC manual.  After reading what you wrote and all of 7.6 (Class and 
instances declarations) a couple of times I think I've got it.

As it says in 7.7.2.2.2, "[t]he instance declarations of a type family used in 
a single program may only overlap if the right-hand sides of the overlapping 
instances coincide for the overlapping types."

Cheers!  -Tyson

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Glasgow-haskell-users mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to