package core_kernel

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

Install

dune-project
 Dependency

Authors

Maintainers

Sources

core_kernel-v0.15.0.tar.gz
sha256=34a0288f16027c6b90e4ad16cb5cc677d7063d310faf918748ce70f1745116c0

doc/core_kernel.moption/Moption/index.html

Module 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
val sexp_of_t : ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.t
include Core.Invariant.S1 with type 'a t := 'a t
val invariant : 'a Base__.Invariant_intf.inv -> 'a t Base__.Invariant_intf.inv
module Optional_syntax : Core.Optional_syntax.S1 with type 'a t := 'a t with type 'a value := 'a
val create : unit -> _ t
val is_none : _ t -> bool
val is_some : _ t -> bool
val get : 'a t -> 'a 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 option -> unit
val set_none : _ t -> unit
val set_some : 'a t -> 'a -> unit