1 (***********************************************************************)
5 (* Kim Nguyen, LRI UMR8623 *)
6 (* Université Paris-Sud & CNRS *)
8 (* Copyright 2010-2012 Université Paris-Sud and Centre National de la *)
9 (* Recherche Scientifique. All rights reserved. This file is *)
10 (* distributed under the terms of the GNU Lesser General Public *)
11 (* License, with the special exception on linking described in file *)
14 (***********************************************************************)
17 Time-stamp: <Last modified on 2013-03-04 23:00:19 CET by Kim Nguyen>
20 (** Various generic signatures and generic module and functor definitions
24 module HashSet (H : Hashtbl.HashedType) :
25 Common_sig.HashSet with type data = H.t =
27 module T = Hashtbl.Make(H)
31 let add h v = T.add h v v
34 let find_all = T.find_all
39 module Pair (X : Common_sig.Type) (Y : Common_sig.Type) :
40 Common_sig.Type with type t = X.t * Y.t =
43 let hash (x, y) = HASHINT2(X.hash x, Y.hash y)
44 let compare (x1, y1) (x2, y2) =
45 let r = X.compare x1 x2 in
46 if r != 0 then r else Y.compare y1 y2
50 and x2, y2 = p2 in X.equal x1 x2 && Y.equal y1 y2