Module Opt

module Opt: sig .. end
Useful option combinators

val inhabited : 'a option -> bool
val get : 'a option -> 'a
val get_exn : exn -> 'a option -> 'a
val get_def : 'a -> 'a option -> 'a
val map : ('a -> 'b) -> 'a option -> 'b option
val iter : ('a -> unit) -> 'a option -> unit
val apply : 'b -> ('a -> 'b) option -> 'a -> 'b
val apply2 : 'c -> ('a -> 'b -> 'c) option -> 'a -> 'b -> 'c
val fold : ('b -> 'a -> 'b) -> 'b -> 'a option -> 'b
fold f d o returns d if o is None, and f d x if o is Some x
val fold_right : ('a -> 'b -> 'b) -> 'a option -> 'b -> 'b
val map2 : ('a -> 'b -> 'c) -> 'a option -> 'b option -> 'c option
val equal : ('a -> 'b -> bool) -> 'a option -> 'b option -> bool
val compare : ('a -> 'b -> int) -> 'a option -> 'b option -> int
val map_fold : ('a -> 'b -> 'a * 'b) -> 'a -> 'b option -> 'a * 'b option