Module of module types for OrderedType,ComparableType,Printable,Serializable,Discrete...
[ocaml.git] / ocamlbuild / tags.ml
blobbd5a02d189f69df0e617e6661cbd129eda1d637d
1 (***********************************************************************)
2 (* ocamlbuild *)
3 (* *)
4 (* Nicolas Pouillard, Berke Durak, projet Gallium, INRIA Rocquencourt *)
5 (* *)
6 (* Copyright 2007 Institut National de Recherche en Informatique et *)
7 (* en Automatique. All rights reserved. This file is distributed *)
8 (* under the terms of the Q Public License version 1.0. *)
9 (* *)
10 (***********************************************************************)
12 (* $Id$ *)
13 (* Original author: Nicolas Pouillard *)
14 include Set.Make(String)
16 (**
17 does_match {foo, bar, baz} {foo} => ok
18 does_match {foo, bar, baz} {foo, boo} => ko
19 does_match {foo, bar, baz} {} => ok
20 does_match {foo, bar, baz} {foo, bar, baz} => ok
22 let does_match x y = subset y x
24 let of_list l = List.fold_right add l empty
26 open Format
28 let print f s =
29 let () = fprintf f "@[<0>" in
30 let _ =
31 fold begin fun elt first ->
32 if not first then fprintf f ",@ ";
33 pp_print_string f elt;
34 false
35 end s true in
36 fprintf f "@]"
38 module Operators = struct
39 let ( ++ ) x y = add y x
40 let ( -- ) x y = remove y x
41 let ( +++ ) x = function Some y -> add y x | None -> x
42 let ( --- ) x = function Some y -> remove y x | None -> x
43 end