DData revision /equivalence vs equality
wolfgang at jeltsch.net
Wed Mar 17 14:50:53 EST 2004
Am Mittwoch, 17. März 2004 13:30 schrieb Ketil Malde:
> > Furthermore, having only an equivalence implies that there is a
> > stronger equality below that cannot be also an instance of Eq.
> I've already said that I think Eq's (==) should be "structural
> equality", which I thought meant that there shouldn't be any
> "deeper" equality.
I think, the name "structural equality" is misleading because it seems to
imply that equivalent values have to have the same (internal) structure. If
values a and b have different internal representations but are
indistinguishable for the library user, than a == b should hold.
But I totally agree with you that == should mean equality and not anything
different. And this is also what The Haskell Report says in § 6.3.1: "The Eq
class provides equality (==) and inequality (/=) methods." So a lot of the
MultiSet/Bag and the bias discussion can be avoided. DData can and should
assume that the Eq methods mean exactly what they are supposed to mean:
equality and inequality.
More information about the Libraries