Missing definitions of associated types

Reid Barton rwbarton at gmail.com
Thu Feb 18 17:49:30 UTC 2016

Well, I see your point; but you also can't define a

On Thu, Feb 18, 2016 at 12:00 PM, David Feuer <david.feuer at gmail.com> wrote:

> It seems to be that a missing associated type definition should be an
> error, by default, rather than a warning. The current behavior under those
> circumstances strikes me as very strange, particularly for data families
> and particularly in the presence of overlapping.

> This compiles with just a warning because Assoc Char *falls through* to
> the general case. WAT? This breaks all my intuition about what associated
> types are supposed to be about.
Well, I see your point; but you also can't give a definition for Assoc Char
in the Foo Char instance, because open data family instances are not
allowed to overlap. So if failing to give a definition for an associated
data family is an error, then it's impossible to use overlapping instances
with classes that have associated data families. Is that your intention?

I don't have a strong opinion here. I'm mildly inclined to say that people
using overlapping instances have already signed themselves up for weird
things happening, and we may as well let them do whatever other weird
things they want.

Reid Barton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20160218/f4fcb9e3/attachment.html>

More information about the ghc-devs mailing list