X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=ptset.ml;h=584ea0aef5a310b010230a8fbbab79550194001b;hb=c5f06d325240c808a9be4d71e20fc01969420bb3;hp=3185da4ea97a214875b9073266165d58647f3fab;hpb=b82be3bb29963ce00218ccc59e1622e284145351;p=SXSI%2Fxpathcomp.git diff --git a/ptset.ml b/ptset.ml index 3185da4..584ea0a 100644 --- a/ptset.ml +++ b/ptset.ml @@ -21,7 +21,7 @@ sig val node : t -> data end -module Make ( H : Hcons.S ) : S with type elt = H.t = +module Make ( H : Hcons.SA ) : S with type elt = H.t = struct type elt = H.t type 'a node = @@ -377,15 +377,25 @@ let from_list l = List.fold_left (fun acc e -> add e acc) empty l end -module Int : S with type elt = int - = - Make ( struct type t = int - type data = t - external hash : t -> int = "%identity" - external uid : t -> int = "%identity" - let equal : t -> t -> bool = (==) - external make : t -> int = "%identity" - external node : t -> int = "%identity" - - end - ) +module Int : sig + include S with type elt = int + val print : Format.formatter -> t -> unit +end + = +struct + include Make ( struct type t = int + type data = t + external hash : t -> int = "%identity" + external uid : t -> int = "%identity" + let equal : t -> t -> bool = (==) + external make : t -> int = "%identity" + external node : t -> int = "%identity" + + end + ) + let print ppf s = + Format.pp_print_string ppf "{ "; + iter (fun i -> Format.fprintf ppf "%i " i) s; + Format.pp_print_string ppf "}"; + Format.pp_print_flush ppf () + end