jon.recoil.org

Module Core.OptionSource

This module extends Base.Option with bin_io, quickcheck, and support for ppx_optional.

Sourcetype ('a : value_or_null) t = 'a Base.Option.t
Sourceval bin_size_t : ('a : value_or_null). ('a : value_or_null) Bin_prot.Size.sizer -> ('a : value_or_null) Core.Option.t Bin_prot.Size.sizer
Sourceval bin_size_t__local : ('a : value_or_null). ('a : value_or_null) Bin_prot.Size.sizer__local -> ('a : value_or_null) Core.Option.t Bin_prot.Size.sizer__local
Sourceval bin_write_t : ('a : value_or_null). ('a : value_or_null) Bin_prot.Write.writer -> ('a : value_or_null) Core.Option.t Bin_prot.Write.writer
Sourceval bin_write_t__local : ('a : value_or_null). ('a : value_or_null) Bin_prot.Write.writer__local -> ('a : value_or_null) Core.Option.t Bin_prot.Write.writer__local
Sourceval bin_writer_t : ('a : value_or_null). ('a : value_or_null) Bin_prot.Type_class.writer -> ('a : value_or_null) Core.Option.t Bin_prot.Type_class.writer
Sourceval bin_read_t : ('a : value_or_null). ('a : value_or_null) Bin_prot.Read.reader -> ('a : value_or_null) Core.Option.t Bin_prot.Read.reader
Sourceval __bin_read_t__ : ('a : value_or_null). ('a : value_or_null) Bin_prot.Read.reader -> ('a : value_or_null) Core.Option.t Bin_prot.Read.vtag_reader
Sourceval bin_reader_t : ('a : value_or_null). ('a : value_or_null) Bin_prot.Type_class.reader -> ('a : value_or_null) Core.Option.t Bin_prot.Type_class.reader
Sourceval bin_t : ('a : value_or_null). ('a : value_or_null) Bin_prot.Type_class.t -> ('a : value_or_null) Core.Option.t Bin_prot.Type_class.t
Sourceval bin_shape_t__bits64 : Bin_prot.Shape.t -> Bin_prot.Shape.t @@ portable
Sourceval bin_shape_t__bits32 : Bin_prot.Shape.t -> Bin_prot.Shape.t @@ portable
Sourceval bin_shape_t__word : Bin_prot.Shape.t -> Bin_prot.Shape.t @@ portable
Sourceval bin_shape_t__float64 : Bin_prot.Shape.t -> Bin_prot.Shape.t @@ portable
Sourceval bin_shape_t__float32 : Bin_prot.Shape.t -> Bin_prot.Shape.t @@ portable
Sourceval bin_size_t__bits64 : 'a Bin_prot.Size.sizer -> 'a Base.Option.Constructors.t__bits64 Bin_prot.Size.sizer @@ portable
Sourceval bin_size_t__bits64__local : 'a Bin_prot.Size.sizer__local -> 'a Base.Option.Constructors.t__bits64 Bin_prot.Size.sizer__local @@ portable
Sourceval bin_write_t__bits64 : 'a Bin_prot.Write.writer -> 'a Base.Option.Constructors.t__bits64 Bin_prot.Write.writer @@ portable
Sourceval bin_write_t__bits64__local : 'a Bin_prot.Write.writer__local -> 'a Base.Option.Constructors.t__bits64 Bin_prot.Write.writer__local @@ portable
Sourceval bin_writer_t__bits64 : 'a Bin_prot.Type_class.writer -> 'a Base.Option.Constructors.t__bits64 Bin_prot.Type_class.writer @@ portable
Sourceval bin_size_t__bits32 : 'a Bin_prot.Size.sizer -> 'a Base.Option.Constructors.t__bits32 Bin_prot.Size.sizer @@ portable
Sourceval bin_size_t__bits32__local : 'a Bin_prot.Size.sizer__local -> 'a Base.Option.Constructors.t__bits32 Bin_prot.Size.sizer__local @@ portable
Sourceval bin_write_t__bits32 : 'a Bin_prot.Write.writer -> 'a Base.Option.Constructors.t__bits32 Bin_prot.Write.writer @@ portable
Sourceval bin_write_t__bits32__local : 'a Bin_prot.Write.writer__local -> 'a Base.Option.Constructors.t__bits32 Bin_prot.Write.writer__local @@ portable
Sourceval bin_writer_t__bits32 : 'a Bin_prot.Type_class.writer -> 'a Base.Option.Constructors.t__bits32 Bin_prot.Type_class.writer @@ portable
Sourceval bin_size_t__word : 'a Bin_prot.Size.sizer -> 'a Base.Option.Constructors.t__word Bin_prot.Size.sizer @@ portable
Sourceval bin_size_t__word__local : 'a Bin_prot.Size.sizer__local -> 'a Base.Option.Constructors.t__word Bin_prot.Size.sizer__local @@ portable
Sourceval bin_write_t__word : 'a Bin_prot.Write.writer -> 'a Base.Option.Constructors.t__word Bin_prot.Write.writer @@ portable
Sourceval bin_write_t__word__local : 'a Bin_prot.Write.writer__local -> 'a Base.Option.Constructors.t__word Bin_prot.Write.writer__local @@ portable
Sourceval bin_writer_t__word : 'a Bin_prot.Type_class.writer -> 'a Base.Option.Constructors.t__word Bin_prot.Type_class.writer @@ portable
Sourceval bin_size_t__float64 : 'a Bin_prot.Size.sizer -> 'a Base.Option.Constructors.t__float64 Bin_prot.Size.sizer @@ portable
Sourceval bin_size_t__float64__local : 'a Bin_prot.Size.sizer__local -> 'a Base.Option.Constructors.t__float64 Bin_prot.Size.sizer__local @@ portable
Sourceval bin_write_t__float64 : 'a Bin_prot.Write.writer -> 'a Base.Option.Constructors.t__float64 Bin_prot.Write.writer @@ portable
Sourceval bin_write_t__float64__local : 'a Bin_prot.Write.writer__local -> 'a Base.Option.Constructors.t__float64 Bin_prot.Write.writer__local @@ portable
Sourceval bin_writer_t__float64 : 'a Bin_prot.Type_class.writer -> 'a Base.Option.Constructors.t__float64 Bin_prot.Type_class.writer @@ portable
Sourceval bin_size_t__float32 : 'a Bin_prot.Size.sizer -> 'a Base.Option.Constructors.t__float32 Bin_prot.Size.sizer @@ portable
Sourceval bin_size_t__float32__local : 'a Bin_prot.Size.sizer__local -> 'a Base.Option.Constructors.t__float32 Bin_prot.Size.sizer__local @@ portable
Sourceval bin_write_t__float32 : 'a Bin_prot.Write.writer -> 'a Base.Option.Constructors.t__float32 Bin_prot.Write.writer @@ portable
Sourceval bin_write_t__float32__local : 'a Bin_prot.Write.writer__local -> 'a Base.Option.Constructors.t__float32 Bin_prot.Write.writer__local @@ portable
Sourceval bin_writer_t__float32 : 'a Bin_prot.Type_class.writer -> 'a Base.Option.Constructors.t__float32 Bin_prot.Type_class.writer @@ portable
Sourceval bin_read_t__bits64 : 'a Bin_prot.Read.reader -> 'a Base.Option.Constructors.t__bits64 Bin_prot.Read.reader @@ portable
Sourceval __bin_read_t__bits64__ : 'a Bin_prot.Read.reader -> 'a Base.Option.Constructors.t__bits64 Bin_prot.Read.vtag_reader @@ portable
Sourceval bin_reader_t__bits64 : 'a Bin_prot.Type_class.reader -> 'a Base.Option.Constructors.t__bits64 Bin_prot.Type_class.reader @@ portable
Sourceval bin_read_t__bits32 : 'a Bin_prot.Read.reader -> 'a Base.Option.Constructors.t__bits32 Bin_prot.Read.reader @@ portable
Sourceval __bin_read_t__bits32__ : 'a Bin_prot.Read.reader -> 'a Base.Option.Constructors.t__bits32 Bin_prot.Read.vtag_reader @@ portable
Sourceval bin_reader_t__bits32 : 'a Bin_prot.Type_class.reader -> 'a Base.Option.Constructors.t__bits32 Bin_prot.Type_class.reader @@ portable
Sourceval bin_read_t__word : 'a Bin_prot.Read.reader -> 'a Base.Option.Constructors.t__word Bin_prot.Read.reader @@ portable
Sourceval __bin_read_t__word__ : 'a Bin_prot.Read.reader -> 'a Base.Option.Constructors.t__word Bin_prot.Read.vtag_reader @@ portable
Sourceval bin_reader_t__word : 'a Bin_prot.Type_class.reader -> 'a Base.Option.Constructors.t__word Bin_prot.Type_class.reader @@ portable
Sourceval bin_read_t__float64 : 'a Bin_prot.Read.reader -> 'a Base.Option.Constructors.t__float64 Bin_prot.Read.reader @@ portable
Sourceval __bin_read_t__float64__ : 'a Bin_prot.Read.reader -> 'a Base.Option.Constructors.t__float64 Bin_prot.Read.vtag_reader @@ portable
Sourceval bin_reader_t__float64 : 'a Bin_prot.Type_class.reader -> 'a Base.Option.Constructors.t__float64 Bin_prot.Type_class.reader @@ portable
Sourceval bin_read_t__float32 : 'a Bin_prot.Read.reader -> 'a Base.Option.Constructors.t__float32 Bin_prot.Read.reader @@ portable
Sourceval __bin_read_t__float32__ : 'a Bin_prot.Read.reader -> 'a Base.Option.Constructors.t__float32 Bin_prot.Read.vtag_reader @@ portable
Sourceval bin_reader_t__float32 : 'a Bin_prot.Type_class.reader -> 'a Base.Option.Constructors.t__float32 Bin_prot.Type_class.reader @@ portable
Sourceval bin_t__bits64 : 'a Bin_prot.Type_class.t -> 'a Base.Option.Constructors.t__bits64 Bin_prot.Type_class.t @@ portable
Sourceval bin_t__bits32 : 'a Bin_prot.Type_class.t -> 'a Base.Option.Constructors.t__bits32 Bin_prot.Type_class.t @@ portable
Sourceval bin_t__word : 'a Bin_prot.Type_class.t -> 'a Base.Option.Constructors.t__word Bin_prot.Type_class.t @@ portable
Sourceval bin_t__float64 : 'a Bin_prot.Type_class.t -> 'a Base.Option.Constructors.t__float64 Bin_prot.Type_class.t @@ portable
Sourceval bin_t__float32 : 'a Bin_prot.Type_class.t -> 'a Base.Option.Constructors.t__float32 Bin_prot.Type_class.t @@ portable

Type and Interfaces

Sourcemodule Constructors = Base.Option.Constructors
include sig ... end
include sig ... end
val compare__bits64 : ('a -> 'a -> int) -> 'a Base.Option.Constructors.t__bits64 -> 'a Base.Option.Constructors.t__bits64 -> int
val compare__bits64__local : ('a @ local -> 'a @ local -> int) -> 'a Base.Option.Constructors.t__bits64 @ local -> 'a Base.Option.Constructors.t__bits64 @ local -> int
val compare__bits32 : ('a -> 'a -> int) -> 'a Base.Option.Constructors.t__bits32 -> 'a Base.Option.Constructors.t__bits32 -> int
val compare__bits32__local : ('a @ local -> 'a @ local -> int) -> 'a Base.Option.Constructors.t__bits32 @ local -> 'a Base.Option.Constructors.t__bits32 @ local -> int
val compare__word : ('a -> 'a -> int) -> 'a Base.Option.Constructors.t__word -> 'a Base.Option.Constructors.t__word -> int
val compare__word__local : ('a @ local -> 'a @ local -> int) -> 'a Base.Option.Constructors.t__word @ local -> 'a Base.Option.Constructors.t__word @ local -> int
val compare__float64 : ('a -> 'a -> int) -> 'a Base.Option.Constructors.t__float64 -> 'a Base.Option.Constructors.t__float64 -> int
val compare__float64__local : ('a @ local -> 'a @ local -> int) -> 'a Base.Option.Constructors.t__float64 @ local -> 'a Base.Option.Constructors.t__float64 @ local -> int
val compare__float32 : ('a -> 'a -> int) -> 'a Base.Option.Constructors.t__float32 -> 'a Base.Option.Constructors.t__float32 -> int
val compare__float32__local : ('a @ local -> 'a @ local -> int) -> 'a Base.Option.Constructors.t__float32 @ local -> 'a Base.Option.Constructors.t__float32 @ local -> int
val compare__'value_bits64' : ('a -> 'a -> int) -> 'a Base.Option.Constructors.t__'value_bits64' -> 'a Base.Option.Constructors.t__'value_bits64' -> int
val compare__'value_bits64'__local : ('a @ local -> 'a @ local -> int) -> 'a Base.Option.Constructors.t__'value_bits64' @ local -> 'a Base.Option.Constructors.t__'value_bits64' @ local -> int
val compare__'value_bits32' : ('a -> 'a -> int) -> 'a Base.Option.Constructors.t__'value_bits32' -> 'a Base.Option.Constructors.t__'value_bits32' -> int
val compare__'value_bits32'__local : ('a @ local -> 'a @ local -> int) -> 'a Base.Option.Constructors.t__'value_bits32' @ local -> 'a Base.Option.Constructors.t__'value_bits32' @ local -> int
val compare__'value_word' : ('a -> 'a -> int) -> 'a Base.Option.Constructors.t__'value_word' -> 'a Base.Option.Constructors.t__'value_word' -> int
val compare__'value_word'__local : ('a @ local -> 'a @ local -> int) -> 'a Base.Option.Constructors.t__'value_word' @ local -> 'a Base.Option.Constructors.t__'value_word' @ local -> int
val compare__'value_float64' : ('a -> 'a -> int) -> 'a Base.Option.Constructors.t__'value_float64' -> 'a Base.Option.Constructors.t__'value_float64' -> int
val compare__'value_float64'__local : ('a @ local -> 'a @ local -> int) -> 'a Base.Option.Constructors.t__'value_float64' @ local -> 'a Base.Option.Constructors.t__'value_float64' @ local -> int
val compare__'value_float32' : ('a -> 'a -> int) -> 'a Base.Option.Constructors.t__'value_float32' -> 'a Base.Option.Constructors.t__'value_float32' -> int
val compare__'value_float32'__local : ('a @ local -> 'a @ local -> int) -> 'a Base.Option.Constructors.t__'value_float32' @ local -> 'a Base.Option.Constructors.t__'value_float32' @ local -> int
val compare__'value_value' : ('a -> 'a -> int) -> 'a Base.Option.Constructors.t__'value_value' -> 'a Base.Option.Constructors.t__'value_value' -> int
val compare__'value_value'__local : ('a @ local -> 'a @ local -> int) -> 'a Base.Option.Constructors.t__'value_value' @ local -> 'a Base.Option.Constructors.t__'value_value' @ local -> int
val compare__'value_'value_value'' : ('a -> 'a -> int) -> 'a Base.Option.Constructors.t__'value_'value_value'' -> 'a Base.Option.Constructors.t__'value_'value_value'' -> int
val compare__'value_'value_value''__local : ('a @ local -> 'a @ local -> int) -> 'a Base.Option.Constructors.t__'value_'value_value'' @ local -> 'a Base.Option.Constructors.t__'value_'value_value'' @ local -> int
val compare__'value_'value_value_value'' : ('a -> 'a -> int) -> 'a Base.Option.Constructors.t__'value_'value_value_value'' -> 'a Base.Option.Constructors.t__'value_'value_value_value'' -> int
val compare__'value_'value_value_value''__local : ('a @ local -> 'a @ local -> int) -> 'a Base.Option.Constructors.t__'value_'value_value_value'' @ local -> 'a Base.Option.Constructors.t__'value_'value_value_value'' @ local -> int
val compare__'value_'value_value_value_value'' : ('a -> 'a -> int) -> 'a Base.Option.Constructors.t__'value_'value_value_value_value'' -> 'a Base.Option.Constructors.t__'value_'value_value_value_value'' -> int
val compare__'value_'value_value_value_value''__local : ('a @ local -> 'a @ local -> int) -> 'a Base.Option.Constructors.t__'value_'value_value_value_value'' @ local -> 'a Base.Option.Constructors.t__'value_'value_value_value_value'' @ local -> int
val equal__bits64 : ('a -> 'a -> bool) -> 'a Base.Option.Constructors.t__bits64 -> 'a Base.Option.Constructors.t__bits64 -> bool
val equal__bits64__local : ('a @ local -> 'a @ local -> bool) -> 'a Base.Option.Constructors.t__bits64 @ local -> 'a Base.Option.Constructors.t__bits64 @ local -> bool
val equal__bits32 : ('a -> 'a -> bool) -> 'a Base.Option.Constructors.t__bits32 -> 'a Base.Option.Constructors.t__bits32 -> bool
val equal__bits32__local : ('a @ local -> 'a @ local -> bool) -> 'a Base.Option.Constructors.t__bits32 @ local -> 'a Base.Option.Constructors.t__bits32 @ local -> bool
val equal__word : ('a -> 'a -> bool) -> 'a Base.Option.Constructors.t__word -> 'a Base.Option.Constructors.t__word -> bool
val equal__word__local : ('a @ local -> 'a @ local -> bool) -> 'a Base.Option.Constructors.t__word @ local -> 'a Base.Option.Constructors.t__word @ local -> bool
val equal__float64 : ('a -> 'a -> bool) -> 'a Base.Option.Constructors.t__float64 -> 'a Base.Option.Constructors.t__float64 -> bool
val equal__float64__local : ('a @ local -> 'a @ local -> bool) -> 'a Base.Option.Constructors.t__float64 @ local -> 'a Base.Option.Constructors.t__float64 @ local -> bool
val equal__float32 : ('a -> 'a -> bool) -> 'a Base.Option.Constructors.t__float32 -> 'a Base.Option.Constructors.t__float32 -> bool
val equal__float32__local : ('a @ local -> 'a @ local -> bool) -> 'a Base.Option.Constructors.t__float32 @ local -> 'a Base.Option.Constructors.t__float32 @ local -> bool
val equal__'value_bits64' : ('a -> 'a -> bool) -> 'a Base.Option.Constructors.t__'value_bits64' -> 'a Base.Option.Constructors.t__'value_bits64' -> bool
val equal__'value_bits64'__local : ('a @ local -> 'a @ local -> bool) -> 'a Base.Option.Constructors.t__'value_bits64' @ local -> 'a Base.Option.Constructors.t__'value_bits64' @ local -> bool
val equal__'value_bits32' : ('a -> 'a -> bool) -> 'a Base.Option.Constructors.t__'value_bits32' -> 'a Base.Option.Constructors.t__'value_bits32' -> bool
val equal__'value_bits32'__local : ('a @ local -> 'a @ local -> bool) -> 'a Base.Option.Constructors.t__'value_bits32' @ local -> 'a Base.Option.Constructors.t__'value_bits32' @ local -> bool
val equal__'value_word' : ('a -> 'a -> bool) -> 'a Base.Option.Constructors.t__'value_word' -> 'a Base.Option.Constructors.t__'value_word' -> bool
val equal__'value_word'__local : ('a @ local -> 'a @ local -> bool) -> 'a Base.Option.Constructors.t__'value_word' @ local -> 'a Base.Option.Constructors.t__'value_word' @ local -> bool
val equal__'value_float64' : ('a -> 'a -> bool) -> 'a Base.Option.Constructors.t__'value_float64' -> 'a Base.Option.Constructors.t__'value_float64' -> bool
val equal__'value_float64'__local : ('a @ local -> 'a @ local -> bool) -> 'a Base.Option.Constructors.t__'value_float64' @ local -> 'a Base.Option.Constructors.t__'value_float64' @ local -> bool
val equal__'value_float32' : ('a -> 'a -> bool) -> 'a Base.Option.Constructors.t__'value_float32' -> 'a Base.Option.Constructors.t__'value_float32' -> bool
val equal__'value_float32'__local : ('a @ local -> 'a @ local -> bool) -> 'a Base.Option.Constructors.t__'value_float32' @ local -> 'a Base.Option.Constructors.t__'value_float32' @ local -> bool
val equal__'value_value' : ('a -> 'a -> bool) -> 'a Base.Option.Constructors.t__'value_value' -> 'a Base.Option.Constructors.t__'value_value' -> bool
val equal__'value_value'__local : ('a @ local -> 'a @ local -> bool) -> 'a Base.Option.Constructors.t__'value_value' @ local -> 'a Base.Option.Constructors.t__'value_value' @ local -> bool
val equal__'value_'value_value'' : ('a -> 'a -> bool) -> 'a Base.Option.Constructors.t__'value_'value_value'' -> 'a Base.Option.Constructors.t__'value_'value_value'' -> bool
val equal__'value_'value_value''__local : ('a @ local -> 'a @ local -> bool) -> 'a Base.Option.Constructors.t__'value_'value_value'' @ local -> 'a Base.Option.Constructors.t__'value_'value_value'' @ local -> bool
val equal__'value_'value_value_value'' : ('a -> 'a -> bool) -> 'a Base.Option.Constructors.t__'value_'value_value_value'' -> 'a Base.Option.Constructors.t__'value_'value_value_value'' -> bool
val equal__'value_'value_value_value''__local : ('a @ local -> 'a @ local -> bool) -> 'a Base.Option.Constructors.t__'value_'value_value_value'' @ local -> 'a Base.Option.Constructors.t__'value_'value_value_value'' @ local -> bool
val equal__'value_'value_value_value_value'' : ('a -> 'a -> bool) -> 'a Base.Option.Constructors.t__'value_'value_value_value_value'' -> 'a Base.Option.Constructors.t__'value_'value_value_value_value'' -> bool
val equal__'value_'value_value_value_value''__local : ('a @ local -> 'a @ local -> bool) -> 'a Base.Option.Constructors.t__'value_'value_value_value_value'' @ local -> 'a Base.Option.Constructors.t__'value_'value_value_value_value'' @ local -> bool
val sexp_of_t__bits64 : ('a -> Sexplib0.Sexp.t) -> 'a Base.Option.Constructors.t__bits64 -> Sexplib0.Sexp.t
val sexp_of_t__bits32 : ('a -> Sexplib0.Sexp.t) -> 'a Base.Option.Constructors.t__bits32 -> Sexplib0.Sexp.t
val sexp_of_t__word : ('a -> Sexplib0.Sexp.t) -> 'a Base.Option.Constructors.t__word -> Sexplib0.Sexp.t
val sexp_of_t__float64 : ('a -> Sexplib0.Sexp.t) -> 'a Base.Option.Constructors.t__float64 -> Sexplib0.Sexp.t
val sexp_of_t__float32 : ('a -> Sexplib0.Sexp.t) -> 'a Base.Option.Constructors.t__float32 -> Sexplib0.Sexp.t
val sexp_of_t__'value_bits64' : ('a -> Sexplib0.Sexp.t) -> 'a Base.Option.Constructors.t__'value_bits64' -> Sexplib0.Sexp.t
val sexp_of_t__'value_bits32' : ('a -> Sexplib0.Sexp.t) -> 'a Base.Option.Constructors.t__'value_bits32' -> Sexplib0.Sexp.t
val sexp_of_t__'value_word' : ('a -> Sexplib0.Sexp.t) -> 'a Base.Option.Constructors.t__'value_word' -> Sexplib0.Sexp.t
val sexp_of_t__'value_float64' : ('a -> Sexplib0.Sexp.t) -> 'a Base.Option.Constructors.t__'value_float64' -> Sexplib0.Sexp.t
val sexp_of_t__'value_float32' : ('a -> Sexplib0.Sexp.t) -> 'a Base.Option.Constructors.t__'value_float32' -> Sexplib0.Sexp.t
val sexp_of_t__'value_value' : ('a -> Sexplib0.Sexp.t) -> 'a Base.Option.Constructors.t__'value_value' -> Sexplib0.Sexp.t
val sexp_of_t__'value_'value_value'' : ('a -> Sexplib0.Sexp.t) -> 'a Base.Option.Constructors.t__'value_'value_value'' -> Sexplib0.Sexp.t
val sexp_of_t__'value_'value_value_value'' : ('a -> Sexplib0.Sexp.t) -> 'a Base.Option.Constructors.t__'value_'value_value_value'' -> Sexplib0.Sexp.t
val sexp_of_t__'value_'value_value_value_value'' : ('a -> Sexplib0.Sexp.t) -> 'a Base.Option.Constructors.t__'value_'value_value_value_value'' -> Sexplib0.Sexp.t
val sexp_of_t__bits64__stack : ('a @ local -> Sexplib0.Sexp.t @ local) -> 'a Base.Option.Constructors.t__bits64 @ local -> Sexplib0.Sexp.t @ local
val sexp_of_t__bits32__stack : ('a @ local -> Sexplib0.Sexp.t @ local) -> 'a Base.Option.Constructors.t__bits32 @ local -> Sexplib0.Sexp.t @ local
val sexp_of_t__word__stack : ('a @ local -> Sexplib0.Sexp.t @ local) -> 'a Base.Option.Constructors.t__word @ local -> Sexplib0.Sexp.t @ local
val sexp_of_t__float64__stack : ('a @ local -> Sexplib0.Sexp.t @ local) -> 'a Base.Option.Constructors.t__float64 @ local -> Sexplib0.Sexp.t @ local
val sexp_of_t__float32__stack : ('a @ local -> Sexplib0.Sexp.t @ local) -> 'a Base.Option.Constructors.t__float32 @ local -> Sexplib0.Sexp.t @ local
val sexp_of_t__'value_bits64'__stack : ('a @ local -> Sexplib0.Sexp.t @ local) -> 'a Base.Option.Constructors.t__'value_bits64' @ local -> Sexplib0.Sexp.t @ local
val sexp_of_t__'value_bits32'__stack : ('a @ local -> Sexplib0.Sexp.t @ local) -> 'a Base.Option.Constructors.t__'value_bits32' @ local -> Sexplib0.Sexp.t @ local
val sexp_of_t__'value_word'__stack : ('a @ local -> Sexplib0.Sexp.t @ local) -> 'a Base.Option.Constructors.t__'value_word' @ local -> Sexplib0.Sexp.t @ local
val sexp_of_t__'value_float64'__stack : ('a @ local -> Sexplib0.Sexp.t @ local) -> 'a Base.Option.Constructors.t__'value_float64' @ local -> Sexplib0.Sexp.t @ local
val sexp_of_t__'value_float32'__stack : ('a @ local -> Sexplib0.Sexp.t @ local) -> 'a Base.Option.Constructors.t__'value_float32' @ local -> Sexplib0.Sexp.t @ local
val sexp_of_t__'value_value'__stack : ('a @ local -> Sexplib0.Sexp.t @ local) -> 'a Base.Option.Constructors.t__'value_value' @ local -> Sexplib0.Sexp.t @ local
val sexp_of_t__'value_'value_value''__stack : ('a @ local -> Sexplib0.Sexp.t @ local) -> 'a Base.Option.Constructors.t__'value_'value_value'' @ local -> Sexplib0.Sexp.t @ local
val sexp_of_t__'value_'value_value_value''__stack : ('a @ local -> Sexplib0.Sexp.t @ local) -> 'a Base.Option.Constructors.t__'value_'value_value_value'' @ local -> Sexplib0.Sexp.t @ local
val sexp_of_t__'value_'value_value_value_value''__stack : ('a @ local -> Sexplib0.Sexp.t @ local) -> 'a Base.Option.Constructors.t__'value_'value_value_value_value'' @ local -> Sexplib0.Sexp.t @ local
val t_of_sexp__bits64 : (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a Base.Option.Constructors.t__bits64
val t_of_sexp__bits32 : (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a Base.Option.Constructors.t__bits32
val t_of_sexp__word : (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a Base.Option.Constructors.t__word
val t_of_sexp__float64 : (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a Base.Option.Constructors.t__float64
val t_of_sexp__float32 : (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a Base.Option.Constructors.t__float32
val t_of_sexp__'value_bits64' : (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a Base.Option.Constructors.t__'value_bits64'
val t_of_sexp__'value_bits32' : (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a Base.Option.Constructors.t__'value_bits32'
val t_of_sexp__'value_word' : (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a Base.Option.Constructors.t__'value_word'
val t_of_sexp__'value_float64' : (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a Base.Option.Constructors.t__'value_float64'
val t_of_sexp__'value_float32' : (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a Base.Option.Constructors.t__'value_float32'
val t_of_sexp__'value_value' : (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a Base.Option.Constructors.t__'value_value'
val t_of_sexp__'value_'value_value'' : (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a Base.Option.Constructors.t__'value_'value_value''
val t_of_sexp__'value_'value_value_value'' : (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a Base.Option.Constructors.t__'value_'value_value_value''
val t_of_sexp__'value_'value_value_value_value'' : (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a Base.Option.Constructors.t__'value_'value_value_value_value''
include sig ... end
val compare : ('a : value_or_null). (('a : value_or_null) -> ('a : value_or_null) -> int) -> ('a : value_or_null) option -> ('a : value_or_null) option -> int
val compare__local : ('a : value_or_null). (('a : value_or_null) @ local -> ('a : value_or_null) @ local -> int) -> ('a : value_or_null) option @ local -> ('a : value_or_null) option @ local -> int
val equal : ('a : value_or_null). (('a : value_or_null) -> ('a : value_or_null) -> bool) -> ('a : value_or_null) option -> ('a : value_or_null) option -> bool
val equal__local : ('a : value_or_null). (('a : value_or_null) @ local -> ('a : value_or_null) @ local -> bool) -> ('a : value_or_null) option @ local -> ('a : value_or_null) option @ local -> bool
val globalize : ('a : value_or_null). ('a @ local -> 'a) -> 'a option @ local -> 'a option
val hash_fold_t : ('a : value_or_null). (Ppx_hash_lib.Std.Hash.state -> ('a : value_or_null) -> Ppx_hash_lib.Std.Hash.state) -> Ppx_hash_lib.Std.Hash.state -> ('a : value_or_null) option -> Ppx_hash_lib.Std.Hash.state
val sexp_of_t : ('a : value_or_null). (('a : value_or_null) -> Sexplib0.Sexp.t) -> ('a : value_or_null) option -> Sexplib0.Sexp.t
val sexp_of_t__stack : ('a : value_or_null). (('a : value_or_null) @ local -> Sexplib0.Sexp.t @ local) -> ('a : value_or_null) option @ local -> Sexplib0.Sexp.t @ local
val t_of_sexp : ('a : value_or_null). (Sexplib0.Sexp.t -> ('a : value_or_null)) -> Sexplib0.Sexp.t -> ('a : value_or_null) option
val t_sexp_grammar : ('a : value_or_null). ('a : value_or_null) Sexplib0.Sexp_grammar.t -> ('a : value_or_null) option Sexplib0.Sexp_grammar.t @@ portable
include Base.Invariant.S1 with type 'a t := 'a option
val invariant : ('a -> unit) -> 'a option -> unit

Applicative interface

Options form an applicative, where:

  • return x = Some x
  • None <*> x = None
  • Some f <*> None = None
  • Some f <*> Some x = Some (f x)
include Base.Applicative.S__'value_or_null_mod_maybe_null'__local with type ('a : value_or_null) t := 'a option
val apply : ('a -> 'b) option -> 'a option -> 'b option

Applies the functions in one t to the values in another. Well-behaved applicatives satisfy these "laws", using <*> as infix apply:

  • return Fn.id <*> t is equivalent to t
  • return Fn.compose <*> tf <*> tg <*> tx is equivalent to tf <*> (tg <*> tx)
  • return f <*> return x is equivalent to return (f x)
  • tf <*> return x is equivalent to return (fun f -> f x) <*> tf
val both : 'a option -> 'b option -> ('a * 'b) option

Combines values in two ts as tuples. Using <*> as infix apply, equivalent to return (fun a b -> a, b) <*> ta <*> tb.

val map2 : 'a option -> 'b option -> f:('a -> 'b -> 'c) @ local -> 'c option

Combines the contents of two ts. Using <*> as infix apply, equivalent to return f <*> ta <*> tb.

val map3 : 'a option -> 'b option -> 'c option -> f:('a -> 'b -> 'c -> 'd) @ local -> 'd option

Combines the contents of three ts. Using <*> as infix apply, equivalent to return f <*> ta <*> tb <*> tc.

val (<*>) : ('a -> 'b) option -> 'a option -> 'b option
val (<*) : 'a option -> unit option -> 'a option
val (*>) : unit option -> 'a option -> 'a option
Sourcemodule Applicative_infix = Base.Option.Applicative_infix

Monadic interface

Options form a monad, where:

  • return x = Some x
  • (None >>= f) = None
  • (Some x >>= f) = f x
include Base.Monad.S__'value_or_null_mod_maybe_null'__local with type ('a : value_or_null) t := 'a option
val join : 'a option option -> 'a option

Combines nested t into just one layer. Equivalent to bind t ~f:Fn.id.

val ignore_m : 'a option -> unit option

Ignores contained values of t. Equivalent to map t ~f:ignore.

val all : 'a option list -> 'a list option

Combines a list of t.

val all_unit : unit option list -> unit option

Combines a list of t whose contents are unimportant.

val (>>=) : 'a option -> ('a -> 'b option) @ local -> 'b option

Infix bind.

val (>>|) : 'a option -> ('a -> 'b) @ local -> 'b option

Infix map.

Sourcemodule Monad_infix = Base.Option.Monad_infix
Sourcemodule Let_syntax = Base.Option.Let_syntax

Extracting Underlying Values

include sig ... end
include sig ... end
val value : ('a : value_or_null). 'a option -> default:'a -> 'a

Extracts the underlying value if present, otherwise returns default.

val value_exn : ('a : value_or_null). here:lexing_position -> ?error:Base.Error.t -> ?message:string -> 'a option -> 'a

Extracts the underlying value, or raises if there is no value present. The raised error can be augmented using the ~error and ~message optional arguments. If neither is provided, the raised error will include the provided location.

val value_or_thunk : ('a : value_or_null). 'a option -> default:(unit -> 'a) @ local -> 'a

Extracts the underlying value if present, otherwise executes and returns the result of default. default is only executed if the underlying value is absent.

val iter : ('a : value_or_null). 'a option -> f:('a -> unit) @ local -> unit
include sig ... end
include sig ... end
val value_map : ('a : value_or_null) ('b : value_or_null). 'a option -> default:'b -> f:('a -> 'b) @ local -> 'b

Extracts the underlying value and applies f to it if present, otherwise returns default.

val map : ('a : value_or_null) ('b : value_or_null). 'a option -> f:('a -> 'b) @ local -> 'b option
val bind : ('a : value_or_null) ('b : value_or_null). 'a option -> f:('a -> 'b option) @ local -> 'b option
val fold : ('a : value_or_null) ('acc : value_or_null). 'a option -> init:'acc -> f:('acc -> 'a -> 'acc) @ local -> 'acc

On None, returns init. On Some x, returns f init x.

val mem : ('a : value_or_null). 'a option -> 'a -> equal:('a -> 'a -> bool) @ local -> bool

Checks whether the provided element is there, using equal.

val length : ('a : value_or_null). 'a option -> int
val exists : ('a : value_or_null). 'a option -> f:('a -> bool) @ local -> bool

On None, returns false. On Some x, returns f x.

val for_all : ('a : value_or_null). 'a option -> f:('a -> bool) @ local -> bool

On None, returns true. On Some x, returns f x.

val find : ('a : value_or_null). 'a option -> f:('a -> bool) @ local -> 'a option

find t ~f returns t if t = Some x and f x = true; otherwise, find returns None.

val find_map : ('a : value_or_null) ('b : value_or_null). 'a option -> f:('a -> 'b option) @ local -> 'b option

On None, returns None. On Some x, returns f x.

val to_list : ('a : value_or_null). 'a option -> 'a list
val to_array : 'a. 'a option -> 'a array
val call : ('a : value_or_null). 'a -> f:('a -> unit) option @ local -> unit

call x f runs an optional function ~f on the argument.

val merge : ('a : value_or_null). 'a option -> 'a option -> f:('a -> 'a -> 'a) @ local -> 'a option

merge a b ~f merges together the values from a and b using f. If both a and b are None, returns None. If only one is Some, returns that one, and if both are Some, returns Some of the result of applying f to the contents of a and b.

val filter : ('a : value_or_null). 'a option -> f:('a -> bool) @ local -> 'a option

Constructors

val try_with : ('a : value_or_null). (unit -> 'a) @ local -> 'a option

try_with f returns Some x if f returns x and None if f raises an exception. See Result.try_with if you'd like to know which exception.

val try_with_join : ('a : value_or_null). (unit -> 'a option) @ local -> 'a option

try_with_join f returns the optional value returned by f if it exits normally, and None if f raises an exception.

include sig ... end
val some : ('a : value_or_null). 'a -> 'a option

Wraps the Some constructor as a function.

val return : ('a : value_or_null). 'a -> 'a option
val first_some : ('a : value_or_null). 'a option -> 'a option -> 'a option

first_some t1 t2 returns t1 if it has an underlying value, or t2 otherwise.

val first_some_thunk : ('a : value_or_null). 'a option -> (unit -> 'a option) @ local -> 'a option

first_some_thunk a b is like first_some, but it only computes b () if a is None

val some_if : ('a : value_or_null). bool -> 'a -> 'a option

some_if b x converts a value x to Some x if b, and None otherwise.

val some_if_thunk : ('a : value_or_null). bool -> (unit -> 'a) @ local -> 'a option

Like some_if, but only computes x () if b is true.

Predicates

include sig ... end
val is_none : ('a : value_or_null). 'a option @ local contended -> bool

is_none t returns true iff t = None.

val is_some : ('a : value_or_null). 'a option @ local contended -> bool

is_some t returns true iff t = Some x.

include Core.Comparator.Derived with type 'a t := 'a Core.Option.t
type !'cmp comparator_witness
Sourceval validate : none:unit Validate.check -> some:'a Validate.check -> 'a Core.Option.t Validate.check @@ portable
Sourcemodule Stable : sig ... end
Sourcemodule Optional_syntax : Core.Optional_syntax.S1__local with type 'a t := 'a Core.Option.t and type 'a value := 'a

You might think that it's pointless to have Optional_syntax on options because OCaml already has nice syntax for matching on options. The reason to have this here is that you might have, for example, a tuple of an option and some other type that supports Optional_syntax. Since Optional_syntax can only be opted into at the granularity of the whole match expression, we need this Optional_syntax support for options in order to use it for the other half of the tuple.