Promise.Array

val find_map : ('a -> 'b option t) -> 'a array -> 'b option t

find_map f a applies f to the elements of a in order, and resolves the first result of the form Some v, or None if none exist.

find_map f a

f

a

Some v

None

val filter_map : ('a -> 'b option t) -> 'a array -> 'b array t

filter_map f a applies f to every element of a, filters out the None elements and resolves the list of the arguments of the Some elements.

filter_map f a

Some