Module Tnode.Prec_cell

A node's delayed precision, sealed (gh-ocannl-1624) together with the storage precision it settles into: read with get, written only by the guarded update_prec / update_infer_prec -- which update_prec and update_infer_prec wrap -- each write that changes the value reported to prec_write_hook. storage is the node's storage_prec, forced from the value; once it is forced, update_prec only validates and update_infer_prec refuses. The cell owns that lazy, so no caller can hand the guard a different one.

type t
val sexp_of_t : t -> Sexplib0.Sexp.t
val make : delayed_prec -> t
val get : t -> delayed_prec
val storage : t -> Ops.prec Lazy.t
val update_prec : ?only_if:(Ops.prec -> Base.bool) -> name:(Base.unit -> Base.string) -> t -> Ops.prec -> Base.unit
val update_infer_prec : ?only_if:(Ops.prec -> Base.bool) -> name:(Base.unit -> Base.string) -> t -> Ops.prec Lazy.t -> Base.unit
type snapshot

The cell's value at a checkpoint, bound to the cell (gh-ocannl-903).

val snapshot : t -> snapshot
val restore : snapshot -> Base.unit

Puts the recorded value back, as a counted write.

val settling_began_since : snapshot -> Base.bool

Whether forcing the cell's storage began after the snapshot -- returned or raised: either way its lazy is memoized, and no rewind can reset it.

val snapshot_changed : snapshot -> Base.bool

Whether the value differs (physically) from the recorded one: a diagnostic.