It certainly makes perfect sense, because total order antisymmetry law states that

IF a <= b AND b <= a THEN a = b

However it should rather be written

IF a <= b AND b <= a THEN a ~= b,

since = could be any equivalence class. However, we can also specify the Ord on type

type Foo = Foo Int (Int->Int)

in this way:

instance Ord Foo where
   compare (Foo a _) (Foo b _) = compare a b

which yields equivalence relation that is not assuming equivalence of the functions.
So this restriction does not seem to work on Adrian Hey's side.



Christopher Skrzêtnicki


On Mon, Mar 10, 2008 at 8:06 PM, Dan Weston <westondan@imageworks.com> wrote:
On the other hand, though the behavior of == is not defined by the
Report, it does require in 6.3.1 that if compare is defined, then ==
must be defined. That strongly implies a semantic causal link (in the
Free Theorem kind of way), that the semantics of Ord completely specify
the semantics of Eq, and the only free and continuous way to specify
this is to make == and EQ always agree.

I would (almost) take this conclusion as normative as well.

Dan