package core_kernel

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

This module implements an option ref that starts out as None, and may be set only once. If one tries to set it twice a run time error is generated.

exception Already_set
type 'a t
include sig ... end
val bin_read_t : 'a Bin_prot.Read.reader -> 'a t Bin_prot.Read.reader
val __bin_read_t__ : 'a Bin_prot.Read.reader -> (Base.Int.t -> 'a t) Bin_prot.Read.reader
val bin_size_t : 'a Bin_prot.Size.sizer -> 'a t Bin_prot.Size.sizer
val bin_write_t : 'a Bin_prot.Write.writer -> 'a t Bin_prot.Write.writer
val bin_shape_t : Bin_prot.Shape.t -> Bin_prot.Shape.t
val t_of_sexp : (Sexplib.Sexp.t -> 'a) -> Sexplib.Sexp.t -> 'a t
val sexp_of_t : ('a -> Sexplib.Sexp.t) -> 'a t -> Sexplib.Sexp.t

Passes when unset.

include Base.Invariant.S1 with type 'a t := 'a t
val invariant : ('a -> unit) -> 'a t -> unit
val create : Base.Unit.t -> 'a t
val set : 'a t -> 'a -> (Base.Unit.t, Base.String.t) Result.t
val set_exn : 'a t -> 'a -> Base.Unit.t
val get : 'a t -> 'a Base.Option.t
val get_exn : 'a t -> 'a
OCaml

Innovation. Community. Security.