-let rec norm n =
- let v = { id = gen_uid ();
- key = Node.hash_node n;
- node = n }
- in
- WH.merge pool v
-
-(* WH.merge pool *)
-
-let branch p m l r = norm (Branch(p,m,l,r))
-let leaf k = norm (Leaf k)
-
-(* To enforce the invariant that a branch contains two non empty sub-trees *)
-let branch_ne = function
- | (_,_,e,t) when is_empty e -> t
- | (_,_,t,e) when is_empty e -> t
- | (p,m,t0,t1) -> branch p m t0 t1
-
-(********** from here on, only use the smart constructors *************)
-
-let zero_bit k m = (k land m) == 0
+ let empty = HNode.make Empty
+
+ let is_empty s = (HNode.node s) == Empty
+
+ let branch p m l r = HNode.make (Branch(p,m,l,r))