From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by pauillac.inria.fr; Tue, 18 Oct 94 10:43:55 +0100 Received: by pauillac.inria.fr; Tue, 18 Oct 94 10:43:07 +0100 From: Pierre Weis 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) X-Mailer: ELM [version 2.4 PL21] Content-Type: text/plain Sender: weis@pauillac.inria.fr 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