
At Sun, 29 May 2011 19:35:15 -0400, Dan Doel wrote:
On Sun, May 29, 2011 at 6:45 PM, Ben Millwood
wrote: 1) Disallow the overlapping instance C Int Char, because it is incompatible with the C Int Int from the other module. This is what GHC 7 seems to do.
This seems like the only reasonable option given the meaning of functional dependencies.
Also, in an unrelated direction: there are conditions on type families that can allow some overlapping to be permitted. For instance, if you simply want a closed type function, like, taking the above as an example:
type family F a :: * where instance F Int = Char instance F a = a
Something like this would be good. Though you'd need a corresponding value-level mechanism. Is this part of any pending proposal? I don't suppose there's any way to get GHC to accept such code? I only found one cryptic mention of "closed synonym families" under a speculative ideas list for type functions. David