Safety commit before clean-up
[SXSI/xpathcomp.git] / hlist.ml
index 5509871..0e50d61 100644 (file)
--- a/hlist.ml
+++ b/hlist.ml
@@ -13,7 +13,7 @@ module type S = sig
   type data = Data.t
   type t = Node.t
   val hash : t -> int
-  val uid : t -> int
+  val uid : t -> Uid.t
   val make : data -> t
   val equal : t -> t -> bool
   val nil : t
@@ -27,6 +27,8 @@ module type S = sig
   val rev : t -> t
   val rev_map : (elt -> elt) -> t -> t
   val length : t -> int
+
+  val with_id : Uid.t -> t
 end
 
 module Make ( H : Hcons.SA ) : S with type elt = H.t =
@@ -44,7 +46,7 @@ struct
        | _ -> false
     let hash = function 
       | Nil -> 0
-      | Cons(a,aa) -> HASHINT3(PRIME3,H.uid a, aa.Node.id)
+      | Cons(a,aa) -> HASHINT3(PRIME3,Uid.to_int (H.uid a),Uid.to_int( aa.Node.id))
   end
   type data = Data.t
   type t = Node.t
@@ -82,4 +84,7 @@ struct
   let rev l = fold cons l nil
   let rev_map f l = fold (fun x acc -> cons (f x) acc) l nil
   let length l = fold (fun _ c -> c+1) l 0 
+    
+
+  let with_id = Node.with_id
 end