Polymorphic comparison

Pierre Weis (weis@pauillac.inria.fr)
Tue, 18 Oct 1994 10:43:07 +0100 (MET)

From: Pierre Weis <weis@pauillac.inria.fr>
Message-Id: <9410180943.AA28448@pauillac.inria.fr>
Subject: Polymorphic comparison
To: caml-list@pauillac.inria.fr
Date: Tue, 18 Oct 1994 10:43:07 +0100 (MET)

To: caml-list@pauillac.inria.fr
Cc: John.Harrison@cl.cam.ac.uk
Subject: Polymorphic <<
Date: Mon, 17 Oct 94 16:10:57 +0100

Caml has a polymorphic equality with type scheme 'a -> 'a -> bool. It
tests structural equality between values of the same type
(isomorphism), and fails when applied to functions.

On the other hand comparisons are monomorphic: we have comparisons for
integers (prefix <=), strings (le_string), floatting point numbers
(le_float) but no polymorphic comparisons.
In the next 0.7 version of Caml Light, we plan to extend comparisons to a
polymorphic function (i.e. prefix < : 'a -> 'a -> bool, instead of the
now available prefix < : int -> int -> bool).

To extend comparisons to unrelated pairs of values, that is defining
prefix < with type scheme 'a -> 'b -> bool seems a bit strange to me.
What do you plan to do with such a general type scheme for comparisons ?

Pierre