using sets

Eric Dujardin (dujardin@naima.inria.fr)
Mon, 28 Mar 1994 14:37:54 +0200

Date: Mon, 28 Mar 1994 14:37:54 +0200
From: Eric Dujardin <dujardin@naima.inria.fr>
Message-Id: <199403281237.AA12519@naima.inria.fr>
To: caml-list@margaux.inria.fr
Subject: using sets

Hello,

I have defined the following type :

type Lien = {A_lien : Noeud ref ; B_lien :Noeud ref };;

and now I would like to use sets of "Liens". The trouble is that I
don't know how to define a total order over references, to create the
set with the "empty" function. I do not want to compare the values of
the "Noeud" instances, as two distinct instances could have the same
value. I could add an explicit "Identifier" field to my "Noeud"
instances, but it seems that a "magic" function, that would for
example take any reference as parameter and return an integer, would
be more efficient. However, I have no idea how it could be written...

Thanks for any help,

Eric