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 set
s fail.
include sig ... end
val sexp_of_t : ('a ‑> Sexplib.Sexp.t) ‑> 'a t ‑> Sexplib.Sexp.t
Passes when unset.
include Core_kernel__.Import.Invariant.S1 with type a t := a t
val invariant : 'a Base__.Invariant_intf.inv ‑> 'a t Base__.Invariant_intf.inv
val create : Core_kernel__.Import.unit ‑> _ t
val set : 'a t ‑> Source_code_position.t ‑> 'a ‑> Core_kernel__.Import.unit Or_error.t
val set_exn : 'a t ‑> Source_code_position.t ‑> 'a ‑> Core_kernel__.Import.unit
val get : 'a t ‑> 'a Core_kernel__.Import.option
val get_exn : 'a t ‑> Source_code_position.t ‑> 'a
val is_none : _ t ‑> Core_kernel__.Import.bool
val is_some : _ t ‑> Core_kernel__.Import.bool
val iter : 'a t ‑> f:('a ‑> Core_kernel__.Import.unit) ‑> Core_kernel__.Import.unit
module Optional_syntax : Optional_syntax.S1 with type a t := a t with type a value := a Core_kernel__.Import.identity
module Unstable : sig ... end
module Stable : sig ... end