Commit a8731c85 authored by Andrei Paskevich's avatar Andrei Paskevich
Browse files

provide Util.map_join_left

parent 210ce906
......@@ -40,6 +40,10 @@ let map_fold_left f acc l =
let list_all2 pr l1 l2 =
try List.for_all2 pr l1 l2 with Invalid_argument _ -> false
let map_join_left map join = function
| x :: xl -> List.fold_left (fun acc x -> join acc (map x)) (map x) xl
| xl -> raise (Failure "map_join_left")
(* boolean fold accumulators *)
exception FoldSkip
......
......@@ -34,6 +34,8 @@ val map_fold_left :
val list_all2 : ('a -> 'b -> bool) -> 'a list -> 'b list -> bool
val map_join_left : ('a -> 'b) -> ('b -> 'b -> 'b) -> 'a list -> 'b
(* boolean fold accumulators *)
exception FoldSkip
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment