Module Misc_stdlib.List

val is_empty : 'a list -> bool

is_empty l is true if and only if l has no elements. It is equivalent to compare_length_with l 0 = 0.

val map_option : ('a -> 'b option) -> 'a list -> 'b list option
val map3 : ('a -> 'b -> 'c -> 'd) -> 'a list -> 'b list -> 'c list -> 'd list
val some_if_all_elements_are_some : 'a option list -> 'a list option
val iter_until_error : f:('a -> (unit, 'b) Result.t) -> 'a list -> (unit, 'b) Result.t
val merge_iter : cmp:('a -> 'b -> int) -> left_only:('a -> unit) -> right_only:('b -> unit) -> both:('a -> 'b -> unit) -> 'a list -> 'b list -> unit
val merge_fold : cmp:('a -> 'b -> int) -> left_only:('acc -> 'a -> 'acc) -> right_only:('acc -> 'b -> 'acc) -> both:('acc -> 'a -> 'b -> 'acc) -> init:'acc -> 'a list -> 'b list -> 'acc

Folds over two sorted lists, calling left_only on those elements that appear only in the left list, right_only on those elements that appear only in the right list, and both on those elements that appear in both.

val fold_left_map2 : ('acc -> 'a -> 'b -> 'acc * 'r) -> 'acc -> 'a list -> 'b list -> 'acc * 'r list

fold_left_map2 is a combination of fold_left2 and map2 that threads an accumulator through calls to f.