- ;;
-
- type t = HNode.t
- let node = HNode.node
- let hash = HNode.hash
- let equal = HNode.equal
- let uid = HNode.uid
- let nil = HNode.make Nil
- let cons a b = HNode.make (Cons(a,b))
- let hd a =
- match HNode.node a with
- | Nil -> failwith "hd"
- | Cons(a,_) -> a
-
- let tl a =
- match HNode.node a with
- | Nil -> failwith "tl"
- | Cons(_,a) -> a
-
+ type data = Data.t
+ type t = Node.t
+ let make = Node.make
+ let node x = x.Node.node
+ let hash x = x.Node.key
+ let equal = Node.equal
+ let uid x= x.Node.id
+ let nil = Node.make Nil
+ let cons a b = Node.make (Cons(a,b))
+ let hd = function { Node.node = Cons(a,_) } -> a | _ -> failwith "hd"
+ let tl = function { Node.node = Cons(_,a) } -> a | _ -> failwith "tl"