Module Core_kernel__.Moption

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

type 'a t
include sig ... end
val sexp_of_t : ('a ‑> Base.Sexp.t) ‑> 'a t ‑> Base.Sexp.t
include Core_kernel__.Import.Invariant.S1 with type t := a t
type 'a t
module Optional_syntax : Core_kernel.Optional_syntax.S1 with type t := a t with type value := a Core_kernel__.Import.identity
val create : Core_kernel__.Import.unit ‑> _ t
val is_none : _ t ‑> Core_kernel__.Import.bool
val is_some : _ t ‑> Core_kernel__.Import.bool
val get : 'a t ‑> 'a Core_kernel__.Import.option
val get_some_exn : 'a t ‑> 'a
val unsafe_get : 'a t ‑> 'a

Does not check that is_some before unsafely accessing the stored value

val set : 'a t ‑> 'a Core_kernel__.Import.option ‑> Core_kernel__.Import.unit
val set_none : _ t ‑> Core_kernel__.Import.unit
val set_some : 'a t ‑> 'a ‑> Core_kernel__.Import.unit