Core.Set_onceA '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.
include Ppx_compare_lib.Comparable.S1 with type 'a t := 'a tinclude Ppx_compare_lib.Comparable.S1__local with type 'a t := 'a tinclude Ppx_compare_lib.Equal.S1 with type 'a t := 'a tinclude Ppx_compare_lib.Equal.S1__local with type 'a t := 'a tinclude Ppx_quickcheck_runtime.Quickcheckable.S1 with type 'a t := 'a tval quickcheck_generator :
'a Base_quickcheck.Generator.t ->
'a t Base_quickcheck.Generator.tval quickcheck_observer :
'a Base_quickcheck.Observer.t ->
'a t Base_quickcheck.Observer.tval quickcheck_shrinker :
'a Base_quickcheck.Shrinker.t ->
'a t Base_quickcheck.Shrinker.tval sexp_of_t : ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.tPasses when unset.
include Base.Invariant.S1 with type 'a t := 'a tval invariant : ('a -> unit) -> 'a t -> unitval create : Base.Unit.t -> _ tval create_full : here:lexing_position -> 'a -> 'a tval set : 'a t -> here:lexing_position -> 'a -> Base.Unit.t Or_error.tval set_exn : 'a t -> here:lexing_position -> 'a -> Base.Unit.tval set_if_none : 'a t -> here:lexing_position -> 'a -> Base.Unit.tset_if_none t a will do nothing if is_some t, otherwise it will set_exn t a.
val get : 'a t -> 'a Base.Option.tval get_exn : here:lexing_position -> 'a t -> 'aval get_or_set_thunk :
here:lexing_position ->
'a t ->
f:(Base.Unit.t -> 'a) @ local ->
'aGet the value. If it's not set, f () will be called to initialize it.
val is_none : _ t -> Base.Bool.tval is_some : _ t -> Base.Bool.tval iter : 'a t -> f:('a -> Base.Unit.t) @ local -> Base.Unit.tmodule Optional_syntax :
Optional_syntax.S1 with type 'a t := 'a t with type 'a value := 'amodule Unstable : sig ... endmodule Stable : sig ... end