Polymorphic comparison

Judicael Courant (Judicael.Courant@lip.ens-lyon.fr)
Tue, 18 Oct 94 11:40:09 +0100

Date: Tue, 18 Oct 94 11:40:09 +0100
From: Judicael.Courant@lip.ens-lyon.fr (Judicael Courant)
Message-Id: <9410181040.AA18410@lip.ens-lyon.fr>
To: caml-list@pauillac.inria.fr
Subject: Polymorphic comparison

Hello,

I think this polymorphic comparison is quite easy to implement in the
following way:

#open "hashtbl";;
let c x y = (hash x) <= (hash y);;
#infix "c";;

#3 c true;;
- : bool = true
#[ "hello" ; "world" ] c 3.14159;;
- : bool = false

But, as Pierre Weis, I am wondering what to do with such a function...

Maybe
let c (x:'a) (y:'a) = (hash x) <= (hash y);;
would be more suitable ?

-- 
Judicaël COURANT           tel. : 72 72 85 82
ENSL - LIP                 email : Judicael.Courant@ens-lyon.fr
46, allée d'Italie
69364 Lyon cedex 07
--