diff options
Diffstat (limited to 'lib/option.mli')
-rw-r--r-- | lib/option.mli | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/option.mli b/lib/option.mli index 5e085620e..f06ad9f1d 100644 --- a/lib/option.mli +++ b/lib/option.mli @@ -122,5 +122,14 @@ module List : sig [Some y] (in the same order). *) val flatten : 'a option list -> 'a list + (** [List.find f l] is the first [f a] different from [None], + scrolling through elements [a] of [l] in left-to-right order; + it is [None] if no such element exists. *) val find : ('a -> 'b option) -> 'a list -> 'b option + + (** [List.map f [a1;...;an]] is the list [Some [b1;...;bn]] if + for all i, there is a [bi] such that [f ai] is [Some bi]; it is + [None] if, for at least one i, [f ai] is [None]. *) + val map : ('a -> 'b option) -> 'a list -> 'b list option + end |