Module Foldable.Make

Parameters

module X : Basic

Signature

val fold_left : f:('b -> 'a -> 'b) -> init:'b -> 'a X.t -> 'b

Left associative fold of a data structure; this is the same as the function derived from [@@deriving fold] but with labelled arguments

val fold_right : f:('a -> 'b -> 'b) -> init:'b -> 'a X.t -> 'b

Right associative fold of a data structure

val any : pred:('a -> bool) -> ?init:bool -> 'a X.t -> bool

Test whether any element of the data structure satisfies the supplied predicate. The optional argument init specifies the starting value and defaults to false.

val all : pred:('a -> bool) -> ?init:bool -> 'a X.t -> bool

Test whether all elements of the the data structure satify the supplied predicate. The optional argument init specifies the starting value and defaults to true.