package jenga

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

A mutable variable whose state can be watched as a Tenacious computation. 'a Var.t is conceptually a 'a Ref.t with Var.{create,get,set,replace} corresponding to Ref.{create,(!),(:=),replace}. The important difference is the watch function, that lets you construct tenacious computations that depend on the value of the variable.

type 'a t
val create : 'a -> 'a t
val watch : 'a t -> 'a t

a tenacious computation whose value tracks the variable value

val set : 'a t -> 'a -> unit

Set new value for the variable. Any hearts derived from watch are broken immediately.

val get : 'a t -> 'a

Get the current value of the variable without watching it. Should be avoided in Tenacious computations. Use watch instead.

val replace : 'a t -> f:('a -> 'a) -> unit
OCaml

Innovation. Community. Security.