Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
using sets
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Eric Dujardin <dujardin@n...>
Subject: using sets


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,