[Haskell-cafe] Issues(Bugs?) with GHC Type Families

Manuel M T Chakravarty chak at cse.unsw.edu.au
Sun Mar 9 23:14:53 EDT 2008

Hugo Pacheco:
> >If the equality does not hold, you should get a type error because
> >your program is not type correct.  So, what is it that you would like
> >different?
> I would simply like the compiler not to use that instance if the  
> equality constraint does not hold, like some another instance  
> dependency constraint, but I assume that is not possible.

This is independent of type families.  The selection of type class  
instances does *never* dependent on the instance context, only on the  
instance head.  I know that this is sometimes annoying, but type  
checking would be a a lot more complicated/expensive without that rule.


More information about the Haskell-Cafe mailing list