Koen Claessen:
> I would suggest you take a look at Simon, Erik and Mark's paper [1].

Thanks for the suggestion, but I already have.

> My answer is: yes, there are a lot of examples where this is useful.
> Simon's answer is: yes, but allowing this breaks other properties which I
> find more desirable.

> Examples for use of defaults & overlapping instances:

What I was looking for (or at least, wondering about) was the more
specific case I mentioned: a supertype instance which can be defined
entirely in terms of a "default" from a subtype, as can be done in
this case.  This would require a much less general mechanism to
implement, and would certainly not seem to require giving up separate
compilation, as overlapping instances would in general.  But if it also
occurs much more rarely, then there may be little purpose.

>  -- Ord => Eq

>  instance Ord a => Eq a where
>    a == b = a <= b && b <= a

This one qualifies, but isn't the most compelling I can imagine.

Alex.



Reply via email to