package core_kernel

  1. Overview
  2. Docs
Industrial strength alternative to OCaml's standard library

Install

Dune Dependency

Authors

Maintainers

Sources

v0.17.0.tar.gz
sha256=fd2b8c6715794df7a810a62b226f53720f211cd344b4afc9fab0498796d6b466

doc/core_kernel.moption/Moption/index.html

Module MoptionSource

A Moption is a mutable option, like 'a option ref, but with a more efficient implementation; in particular, set_some does not allocate.

Sourcetype !'a t
include Core.Bin_prot.Binable.S1 with type !'a t := 'a t
Sourceval bin_size_t : ('a, 'a t) Bin_prot.Size.sizer1
Sourceval bin_write_t : ('a, 'a t) Bin_prot.Write.writer1
Sourceval bin_read_t : ('a, 'a t) Bin_prot.Read.reader1
Sourceval __bin_read_t__ : ('a, int -> 'a t) Bin_prot.Read.reader1
Sourceval bin_writer_t : ('a, 'a t) Bin_prot.Type_class.S1.writer
Sourceval bin_reader_t : ('a, 'a t) Bin_prot.Type_class.S1.reader
Sourceval bin_t : ('a, 'a t) Bin_prot.Type_class.S1.t
include Sexplib0.Sexpable.S1 with type !'a t := 'a t
Sourceval t_of_sexp : (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a t
Sourceval sexp_of_t : ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.t
include Core.Invariant.S1 with type 'a t := 'a t
Sourceval invariant : ('a -> unit) -> 'a t -> unit
Sourcemodule Optional_syntax : Core.Optional_syntax.S1 with type 'a t := 'a t with type 'a value := 'a
Sourceval create : unit -> _ t
Sourceval is_none : _ t -> bool
Sourceval is_some : _ t -> bool
Sourceval get : 'a t -> 'a option
Sourceval get_some_exn : 'a t -> 'a
Sourceval unsafe_get : 'a t -> 'a

Does not check that is_some before unsafely accessing the stored value

Sourceval set : 'a t -> 'a option -> unit
Sourceval set_none : _ t -> unit
Sourceval set_some : 'a t -> 'a -> unit
Sourcemodule Stable : sig ... end
OCaml

Innovation. Community. Security.