package core

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

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.17.2.tar.gz
md5=6f07bb82d51d695ac4e76c8ac7f55902
sha512=c3c401fded188f74cf7ce6b1b07e7bc59fe18441eec602d174bfd48db13370fda986dd9f66d4ff9c26254ea2b381e7c51b366df9d2dfbf66fda281b4def3166a

doc/core/Core/Set_once/index.html

Module Core.Set_onceSource

A 'a Set_once.t is like an 'a option ref that can only be set once. A Set_once.t starts out as None, the first set transitions it to Some, and subsequent sets fail.

Equality is determined only by the internal value and not the source code position of where the value was set.

Sourcetype 'a t
include Ppx_compare_lib.Comparable.S1 with type 'a t := 'a t
Sourceval compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
include Ppx_compare_lib.Equal.S1 with type 'a t := 'a t
Sourceval equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
Sourceval sexp_of_t : ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.t

Passes when unset.

include Base.Invariant.S1 with type 'a t := 'a t
Sourceval invariant : ('a -> unit) -> 'a t -> unit
Sourceval create : Base.Unit.t -> _ t
Sourceval set_exn : 'a t -> Source_code_position.t -> 'a -> Base.Unit.t
Sourceval set_if_none : 'a t -> Source_code_position.t -> 'a -> Base.Unit.t

set_if_none t here a will do nothing if is_some t, otherwise it will set_exn t here a.

Sourceval get : 'a t -> 'a Base.Option.t
Sourceval get_exn : 'a t -> Source_code_position.t -> 'a
Sourceval is_none : _ t -> Base.Bool.t
Sourceval is_some : _ t -> Base.Bool.t
Sourceval iter : 'a t -> f:('a -> Base.Unit.t) -> Base.Unit.t
Sourcemodule Optional_syntax : Optional_syntax.S1 with type 'a t := 'a t with type 'a value := 'a
Sourcemodule Unstable : sig ... end
Sourcemodule Stable : sig ... end