Not to be picky, but where did you hear that (==) established an
equivalence relation? Not I expect from the Haskell98 Report!
The only law I can find there is that
x /= y iff not (x == y)
So, the definition x == y = False
x /= y = True
would be perfectly legitimate, making x /= x = True, which kind of ruins
the equivalence relation thing, no?
Dan
Wolfgang Jeltsch wrote:
Am Mittwoch, 12. März 2008 00:53 schrieb askyle:
[…]
So if floating point (==) doesn't correspond with numeric equality, it's
not FP's fault, but ours for expecting it to do!
No, I think, it’s the Prelude’s fault to define (==) as “floating point
equality”. We should us a different identifier like floatingPointEq. (==)
is expected to be an equivalence relation. (I think I already said this.)
[…]
Best wishes,
Wolfgang
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe