module type S =
sig
type data
- type t
+ type t
val make : data -> t
val node : t -> data
val hash : t -> int
struct
type data = H.t
type t = { id : int;
- key : int; (* hash *)
+ key : int;
node : data;
}
let gen_uid =
let id = ref ~-1 in
fun () -> incr id;!id
- let equal t1 t2 = t1 == t2 || t1.id == t2.id
+ let equal = (==)
module WH = Weak.Make( struct
type _t = t
type t = _t
let hash = hash
- let equal a b = H.equal a.node b.node
+ let equal a b = a==b || H.equal a.node b.node
end)
let pool = WH.create MED_H_SIZE
let make x =