diff options
Diffstat (limited to '')
| -rw-r--r-- | lib/Utilities.ml | 6 | ||||
| -rw-r--r-- | lib/Utilities.mli | 1 |
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/Utilities.ml b/lib/Utilities.ml index 6f27b30..0472038 100644 --- a/lib/Utilities.ml +++ b/lib/Utilities.ml @@ -93,11 +93,9 @@ module FingerTree = struct match f elem with None -> acc | Some result -> BatFingerTree.snoc acc result) BatFingerTree.empty - let concat_mapm f xs = BatFingerTree.map f xs |> sequence |> Stdlib.Result.map BatFingerTree.append - - let concat_map f = - BatFingerTree.fold_left (fun acc elem -> BatFingerTree.append acc @@ f elem) BatFingerTree.empty + let concat xss = BatFingerTree.fold_left BatFingerTree.append BatFingerTree.empty xss + let concat_mapm f xs = BatFingerTree.map f xs |> sequence |> Stdlib.Result.map concat end module Atomic = struct diff --git a/lib/Utilities.mli b/lib/Utilities.mli index 3f0787f..e748693 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 : 'a BatFingerTree.t BatFingerTree.t -> 'a BatFingerTree.t val concat_mapm : ('a -> ('b BatFingerTree.t, 'e) result) -> 'a BatFingerTree.t -> ('b BatFingerTree.t, 'e) result end |
