mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2026-01-28 03:44:51 -05:00
small comment
This commit is contained in:
parent
2fbf765466
commit
f65bcd212d
2 changed files with 6 additions and 1 deletions
|
|
@ -94,7 +94,9 @@ end
|
||||||
module Make(O : Map.OrderedType) = struct
|
module Make(O : Map.OrderedType) = struct
|
||||||
module M = Map.Make(O)
|
module M = Map.Make(O)
|
||||||
|
|
||||||
(* overload [union] if it's not in [M] *)
|
(* backport functions from recent stdlib.
|
||||||
|
they will be shadowed by inclusion of [S] if present. *)
|
||||||
|
|
||||||
let union f a b =
|
let union f a b =
|
||||||
M.merge
|
M.merge
|
||||||
(fun k v1 v2 -> match v1, v2 with
|
(fun k v1 v2 -> match v1, v2 with
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,9 @@ end
|
||||||
module Make(O : Map.OrderedType) = struct
|
module Make(O : Map.OrderedType) = struct
|
||||||
module S = Set.Make(O)
|
module S = Set.Make(O)
|
||||||
|
|
||||||
|
(* backport functions from recent stdlib.
|
||||||
|
they will be shadowed by inclusion of [S] if present. *)
|
||||||
|
|
||||||
let find_opt x s =
|
let find_opt x s =
|
||||||
try Some (S.find x s)
|
try Some (S.find x s)
|
||||||
with Not_found -> None
|
with Not_found -> None
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue