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 (***********************************************************************)
16 (** Various generic signatures and generic module and functor definitions
21 module HashSet (H : Hashtbl.HashedType) :
22 Sigs.HashSet with type data = H.t =
24 module T = Hashtbl.Make(H)
28 let add h v = T.add h v v
31 let find_all = T.find_all
36 module Pair (X : Sigs.Type) (Y : Sigs.Type) :
37 Sigs.Type with type t = X.t * Y.t =
40 let hash (x, y) = HASHINT2(X.hash x, Y.hash y)
41 let compare (x1, y1) (x2, y2) =
42 let r = X.compare x1 x2 in
43 if r != 0 then r else Y.compare y1 y2
47 and x2, y2 = p2 in X.equal x1 x2 && Y.equal y1 y2