Module Core_kernel.Option
This module extends Base.Option with bin_io, quickcheck, and support for ppx_optional.
type 'a t= 'a Base.Option.t
include Bin_prot.Binable.S1 with type 'a t := 'a t
val bin_shape_t : Bin_prot.Shape.t -> Bin_prot.Shape.tval bin_size_t : ('a, 'a t) Bin_prot.Size.sizer1val bin_write_t : ('a, 'a t) Bin_prot.Write.writer1val bin_read_t : ('a, 'a t) Bin_prot.Read.reader1val __bin_read_t__ : ('a, int -> 'a t) Bin_prot.Read.reader1val bin_writer_t : ('a, 'a t) Bin_prot.Type_class.S1.writerval bin_reader_t : ('a, 'a t) Bin_prot.Type_class.S1.readerval bin_t : ('a, 'a t) Bin_prot.Type_class.S1.t
include Typerep_lib.Typerepable.S1 with type 'a t := 'a t
val typerep_of_t : 'a Typerep_lib.Std_internal.Typerep.t -> 'a t Typerep_lib.Std_internal.Typerep.tval typename_of_t : 'a Typerep_lib.Typename.t -> 'a t Typerep_lib.Typename.t
include module type of sig ... end with type 'a t := 'a option
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> intval hash_fold_t : (Base.Hash.state -> 'a -> Base.Hash.state) -> Base.Hash.state -> 'a t -> Base.Hash.stateval t_of_sexp : (Base.Sexp.t -> 'a) -> Base.Sexp.t -> 'a tval sexp_of_t : ('a -> Base.Sexp.t) -> 'a t -> Base.Sexp.tval mem : 'a t -> 'a -> equal:('a -> 'a -> bool) -> boolval length : 'a t -> intval is_empty : 'a t -> boolval iter : 'a t -> f:('a -> unit) -> unitval fold : 'a t -> init:'accum -> f:('accum -> 'a -> 'accum) -> 'accumval fold_result : 'a t -> init:'accum -> f:('accum -> 'a -> ('accum, 'e) Base.Result.t) -> ('accum, 'e) Base.Result.tval fold_until : 'a t -> init:'accum -> f:('accum -> 'a -> ('accum, 'final) Base__.Container_intf.Continue_or_stop.t) -> finish:('accum -> 'final) -> 'finalval exists : 'a t -> f:('a -> bool) -> boolval for_all : 'a t -> f:('a -> bool) -> boolval count : 'a t -> f:('a -> bool) -> intval sum : (module Base__.Container_intf.Summable with type t = 'sum) -> 'a t -> f:('a -> 'sum) -> 'sumval find : 'a t -> f:('a -> bool) -> 'a optionval find_map : 'a t -> f:('a -> 'b option) -> 'b optionval to_list : 'a t -> 'a listval to_array : 'a t -> 'a arrayval min_elt : 'a t -> compare:('a -> 'a -> int) -> 'a optionval max_elt : 'a t -> compare:('a -> 'a -> int) -> 'a optionval equal : 'a Base.Equal.equal -> 'a t Base.Equal.equalval invariant : 'a Base__.Invariant_intf.inv -> 'a t Base__.Invariant_intf.invval (>>=) : 'a t -> ('a -> 'b t) -> 'b tval (>>|) : 'a t -> ('a -> 'b) -> 'b t
module Monad_infix = Base__Option.Monad_infixval bind : 'a t -> f:('a -> 'b t) -> 'b tval return : 'a -> 'a tval map : 'a t -> f:('a -> 'b) -> 'b tval join : 'a t t -> 'a tval ignore_m : 'a t -> unit tval all : 'a t list -> 'a list tval all_unit : unit t list -> unit t
module Let_syntax = Base__Option.Let_syntaxval is_none : 'a t -> boolval is_some : 'a t -> boolval value_map : 'a t -> default:'b -> f:('a -> 'b) -> 'bval map2 : 'a t -> 'b t -> f:('a -> 'b -> 'c) -> 'c tval call : 'a -> f:('a -> unit) t -> unitval value : 'a t -> default:'a -> 'aval value_exn : ?here:Base__.Source_code_position0.t -> ?error:Base.Error.t -> ?message:string -> 'a t -> 'aval some : 'a -> 'a tval both : 'a t -> 'b t -> ('a * 'b) tval first_some : 'a t -> 'a t -> 'a tval some_if : bool -> 'a -> 'a tval merge : 'a t -> 'a t -> f:('a -> 'a -> 'a) -> 'a tval filter : 'a t -> f:('a -> bool) -> 'a tval try_with : (unit -> 'a) -> 'a tval validate : none:unit Base.Validate.check -> some:'a Base.Validate.check -> 'a t Base.Validate.check
include Comparator.Derived with type 'a t := 'a t
val comparator : ('a, 'cmp) Comparator.comparator -> ('a t, 'cmp comparator_witness) Comparator.comparator
include Quickcheckable.S1 with type 'a t := 'a t
val quickcheck_generator : 'a Base_quickcheck.Generator.t -> 'a t Base_quickcheck.Generator.tval quickcheck_observer : 'a Base_quickcheck.Observer.t -> 'a t Base_quickcheck.Observer.tval quickcheck_shrinker : 'a Base_quickcheck.Shrinker.t -> 'a t Base_quickcheck.Shrinker.t
module Stable : sig ... endmodule Optional_syntax : Optional_syntax.S1 with type 'a t := 'a t and type 'a value := 'aOptional_syntaxallowsOption.ts in the same matched expression as other types usingOptional_syntax.