module Option: BatOptiontype'at ='a option
val some : 'a -> 'a optionsome x returns Some x.val may : ('a -> unit) -> 'a option -> unitmay f (Some x) calls f x and may f None does nothing.val map : ('a -> 'b) -> 'a option -> 'b optionmap f (Some x) returns Some (f x) and map f None returns None.val bind : 'a option -> ('a -> 'b option) -> 'b optionbind (Some x) f returns f x and bind None f returns None.val apply : ('a -> 'a) option -> 'a -> 'aapply None x returns x and apply (Some f) x returns f xval filter : ('a -> bool) -> 'a option -> 'a optionfilter f None returns None, filter f (Some x) returns Some x
if f x is true, and None otherwise.val default : 'a -> 'a option -> 'adefault x (Some v) returns v and default x None returns x.val (|?) : 'a option -> 'a -> 'aBatOption.default, with the arguments reversed.
None |? 10 returns 10, while Some "foo" |? "bar" returns "foo".
Note This operator does not short circuit like ( || ) and ( && ).
Both arguments will be evaluated.
Since 2.0
val default_delayed : (unit -> 'a) -> 'a option -> 'aBatOption.default, but the default value is passed as a thunk that
is only computed if needed.val map_default : ('a -> 'b) -> 'b -> 'a option -> 'bmap_default f x (Some v) returns f v and map_default f x None
returns x.val map_default_delayed : ('a -> 'b) -> (unit -> 'b) -> 'a option -> 'bBatOption.map_default, but the default value is passed as a thunk that
is only computed if needed.val is_none : 'a option -> boolis_none None returns true otherwise it returns false.val is_some : 'a option -> boolis_some (Some x) returns true otherwise it returns false.val get : 'a option -> 'aget (Some x) returns x.Invalid_argument on get None.val get_exn : 'a option -> exn -> 'aget_exn (Some x) e returns x and get_exn None e raises e.val compare : ?cmp:('a -> 'a -> int) -> 'a option -> 'a option -> intNone is always assumed to be less than Some _. The
parameter cmp defaults to Pervasives.compare.val eq : ?eq:('a -> 'a -> bool) -> 'a option -> 'a option -> booleq defaults to
Pervasives.(=).val enum : 'a option -> 'a BatEnum.tenum (Some x) returns the singleton x, while enum None returns
the empty enumeration.val of_enum : 'a BatEnum.t -> 'a optionof_enum e consumes the first element of e, if it exists, and
returns Some e. If e is empty, return None.module Monad:sig..end
val ord : 'a BatOrd.ord -> 'a option BatOrd.ordval print : ('a BatInnerIO.output -> 'b -> unit) ->
'a BatInnerIO.output -> 'b t -> unit
module Labels:sig..end
module Infix:sig..end