From f65bcd212d5e3f47c2c2449a58b2ba605c2aa1ff Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Wed, 29 Nov 2017 14:43:11 +0100 Subject: [PATCH] small comment --- src/core/CCMap.ml | 4 +++- src/core/CCSet.ml | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/CCMap.ml b/src/core/CCMap.ml index 9beedded..5c6f3de8 100644 --- a/src/core/CCMap.ml +++ b/src/core/CCMap.ml @@ -94,7 +94,9 @@ end module Make(O : Map.OrderedType) = struct 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 = M.merge (fun k v1 v2 -> match v1, v2 with diff --git a/src/core/CCSet.ml b/src/core/CCSet.ml index 45195921..1572c2ff 100644 --- a/src/core/CCSet.ml +++ b/src/core/CCSet.ml @@ -65,6 +65,9 @@ end module Make(O : Map.OrderedType) = struct 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 = try Some (S.find x s) with Not_found -> None