val map_or : default:'b ‑> ('a ‑> 'b) ‑> 'a t ‑> 'bmap_or ~default f o is f x if o = Some x, default otherwise
val map_lazy : (unit ‑> 'b) ‑> ('a ‑> 'b) ‑> 'a t ‑> 'bmap_lazy default_fn f o if f o if o = Some x, default_fn () otherwise
val is_some : _ t ‑> boolval get_or : default:'a ‑> 'a t ‑> 'aget_or ~default o extracts the value from o, or
returns default if o = None.
val get_exn : 'a t ‑> 'aOpen the option, possibly failing if it is None
Noneval get_lazy : (unit ‑> 'a) ‑> 'a t ‑> 'aget_lazy default_fn x unwraps x, but if x = None it returns default_fn () instead.
sequence_l [x1; x2; ...; xn] returns Some [y1;y2;...;yn] if
every xi is Some yi. Otherwise, if the list contains at least
one None, the result is None.
val wrap : ?handler:(exn ‑> bool) ‑> ('a ‑> 'b) ‑> 'a ‑> 'b optionwrap f x calls f x and returns Some y if f x = y. If f x raises
any exception, the result is None. This can be useful to wrap functions
such as Map.S.find.
true if the
exception is to be caught.val wrap2 : ?handler:(exn ‑> bool) ‑> ('a ‑> 'b ‑> 'c) ‑> 'a ‑> 'b ‑> 'c optionwrap2 f x y is similar to wrap1 but for binary functions.
module Infix : sig ... endval to_list : 'a t ‑> 'a listval random : 'a random_gen ‑> 'a t random_genchoice_seq s is similar to choice, but works on sequences.
It returns the first Some x occurring in s, or None otherwise.