[Haskell-cafe] Class invariants/laws

ajb at spamcop.net ajb at spamcop.net
Thu Oct 18 23:34:43 EDT 2007


G'day all.

Quoting Janis Voigtlaender <voigt at tcs.inf.tu-dresden.de>:

> Yes. But actually what we would need would be that it checks as well
> that we have implemented at *most* a minimal set of operations.
> Otherwise, we are back to the point where I can implement both (==) and
> (/=), and in a way that the supposed invariant is broken.

Except that there are many circumstances where I can write an operation
that's more efficient (or more lazy, or whatever) than the default, even
though they do the same thing.

Probably not true of (==) vs (/=), but it's often true of (<=) vs
compare.

Cheers,
Andrew Bromage


More information about the Haskell-Cafe mailing list