type 'a t = 'a option
val some : 'a -> 'a optionsome x is Some x.
val get : 'a option -> 'aget (Some a) returns a, and get None raises Invalid_argument.
val get_or : 'a -> 'a option -> 'aget_or d is a variant of get which maps None to d instead of raising an exception.
val get_else : (unit -> 'a) -> 'a option -> 'aget_else h is a variant of get which calls h () to handle the None case instead of raising an exception.
val found : (unit -> 'a) -> 'a optionfound f is try Some (f ()) with Not_found -> None.
val search : ('a -> 'b option) -> 'a option -> 'b optionsearch f None is None and search f (Some a) is f a.
val flatten : 'a option option -> 'a optionflatten maps Some (Some x) to Some x and other values to None.
val return : 'a -> 'a optionval (>>=) : 'a option -> ('a -> 'b option) -> 'b option
val iter : ('a -> unit) -> 'a option -> unititer f (Some a) calls f a, and iter f None does nothing.
val map : ('a -> 'b) -> 'a option -> 'b optionmap f None is None and map f (Some a) is Some (f a).
val fmap : ('a -> 'b option) -> 'a option -> 'b optionfmap f None is None and fmap f (Some a) is f a. Functions as filter ∘ map and as monadic bind.
val fold : ('a -> 'b -> 'b) -> 'a option -> 'b -> 'bfold f None is the identity function and fold f (Some a) is f a.
val for_all : ('a -> bool) -> 'a option -> boolfor_all f None is true and for_all f (Some a) is f a.
val exists : ('a -> bool) -> 'a option -> boolexists f None is false and exists f (Some a) is f a.
val filter : ('a -> bool) -> 'a option -> 'a optionfilter f (Some a) returns Some a if f a is true; in other cases filter f a returns None.
val inter : ('a -> 'b -> 'c) -> 'a option -> 'b option -> 'c optionval union : ('a -> 'a -> 'a) -> 'a option -> 'a option -> 'a optionval compl : ('a -> 'b -> 'b) -> 'a option -> 'b option -> 'b optionval finter : ('a -> 'b -> 'c option) -> 'a option -> 'b option -> 'c optionval funion : ('a -> 'a -> 'a option) -> 'a option -> 'a option -> 'a optionval fcompl : ('a -> 'b -> 'b option) -> 'a option -> 'b option -> 'b option