On 05/07/2018 11:45 PM, Clinton Mead wrote:
Hi Li-yaoNo instance for the C type class above will be picked until x is equal to some applied type constructor; it will be more challenging to break coherence with that than using what you're proposing.
I understand this issue, but I think what your describing doesn't relate to what I'm talking about uniquely.
For example:
instance {-# OVERLAPPABLE #-} Num x => C x where ...
instance {-# OVERLAPPING #-} C Int where ...
is completely legal, and the instance used depends on context.
This is an issue with overlapping instances, but already GHC allows it. I don't think what I'm proposing is any worse to what's already legal.
It seems difficult to make a clear point because the whole topic of coherence with Haskell type classes is already a minefield.
Li-yao
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-caf e
Only members subscribed via the mailman list are allowed to post.