X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=hcons.ml;h=35bc9427232d20ca68173b2c70bb589fca936afd;hb=3445f7f08f15fe41e0d1bfaaabaacf60cdc10b61;hp=eb603855f7a8f32f5694735c1d6a6440d00c1383;hpb=2676d5a3bbb1e6f6a5af66477edfe3b4c849f4e7;p=SXSI%2Fxpathcomp.git diff --git a/hcons.ml b/hcons.ml index eb60385..35bc942 100644 --- a/hcons.ml +++ b/hcons.ml @@ -1,22 +1,34 @@ INCLUDE "utils.ml" -module type S = -sig - type data - type t - val make : data -> t - val node : t -> data - val hash : t -> int - val uid : t -> int - val equal : t -> t -> bool -end +module type SA = + sig + type data + type t + val make : data -> t + val node : t -> data + val hash : t -> int + val uid : t -> int + val equal : t -> t -> bool + end + +module type S = + sig + type data + type t = private { id : int; + key : int; + node : data } + val make : data -> t + val node : t -> data + val hash : t -> int + val uid : t -> int + val equal : t -> t -> bool + end + module Make (H : Hashtbl.HashedType) : S with type data = H.t = struct type data = H.t - type t = { id : int; - key : int; - node : data; - } - + type t = { id : int; + key : int; + node : data } let node t = t.node let hash t = t.key let uid t = t.id