diff options
Diffstat (limited to '')
| -rw-r--r-- | lib/Utilities.ml | 4 | ||||
| -rw-r--r-- | lib/Utilities.mli | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/Utilities.ml b/lib/Utilities.ml index 8b6b08e..dcf4417 100644 --- a/lib/Utilities.ml +++ b/lib/Utilities.ml @@ -92,6 +92,10 @@ module FingerTree = struct (fun acc elem -> match f elem with None -> acc | Some result -> BatFingerTree.snoc acc result) BatFingerTree.empty + + let concat_map f = + BatFingerTree.fold_left (fun acc elem -> BatFingerTree.append acc @@ f elem) BatFingerTree.empty + end module Atomic = struct diff --git a/lib/Utilities.mli b/lib/Utilities.mli index f220b08..7d41e20 100644 --- a/lib/Utilities.mli +++ b/lib/Utilities.mli @@ -36,6 +36,7 @@ module FingerTree : sig val foldm_left : ('a -> 'b -> ('a, 'e) result) -> 'a -> 'b BatFingerTree.t -> ('a, 'e) result val join : string BatFingerTree.t -> string -> string val filter_map : ('a -> 'b option) -> 'a BatFingerTree.t -> 'b BatFingerTree.t + val concat_map : ('a -> ('b BatFingerTree.t, 'e) result) -> 'a BatFingerTree.t -> ('b BatFingerTree.t, 'e) result end module Fun : sig |
