aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/cString.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cString.ml')
-rw-r--r--lib/cString.ml11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/cString.ml b/lib/cString.ml
index 551b62834..842625aa4 100644
--- a/lib/cString.ml
+++ b/lib/cString.ml
@@ -61,6 +61,7 @@ sig
val is_sub : string -> string -> int -> bool
module Set : Set.S with type elt = t
module Map : CMap.ExtS with type key = t and module Set := Set
+ module List : CList.MonoS with type elt = t
val hcons : string -> string
end
@@ -191,4 +192,14 @@ end
module Set = Set.Make(Self)
module Map = CMap.Make(Self)
+module List = struct
+ type elt = string
+ let mem id l = List.exists (equal id) l
+ let assoc id l = CList.assoc_f equal id l
+ let remove_assoc id l = CList.remove_assoc_f equal id l
+ let mem_assoc id l = List.exists (fun (a,_) -> equal id a) l
+ let mem_assoc_sym id l = List.exists (fun (_,b) -> equal id b) l
+ let equal l l' = CList.equal equal l l'
+end
+
let hcons = Hashcons.simple_hcons Hashcons.Hstring.generate ()