From e9cd8eef6fd29e03b809926e35aae57df53aa8d7 Mon Sep 17 00:00:00 2001 From: Pierre-Marie Pédrot Date: Sun, 24 Nov 2013 19:44:10 +0100 Subject: Adding fold_left / fold_right function to maps. --- lib/cMap.mli | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/cMap.mli') diff --git a/lib/cMap.mli b/lib/cMap.mli index 6b61782b05..7091e844e3 100644 --- a/lib/cMap.mli +++ b/lib/cMap.mli @@ -39,6 +39,12 @@ sig (** [bind f s] transform the set [x1; ...; xn] into [x1 := f x1; ...; xn := f xn]. *) + val fold_left : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b + (** Alias for {!fold}, to easily track where we depend on fold order. *) + + val fold_right : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b + (** Folding keys in decreasing order. *) + module Unsafe : sig val map : (key -> 'a -> key * 'b) -> 'a t -> 'b t -- cgit v1.2.3