Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
Var
is the module type of variables, which are the simplest kind of input nodes available to users.
type 'a node := 'a t
val create : 'a -> 'a t
create x
creates a variable with initial value x
create_tracking node
creates a variable that tracks the value of node
. Such a variable behaves as a normal variable except that:
node
at creation timenode
changes, the variable is reset to that of node
.val peek : 'a t -> 'a
peek v
returns the value currently held in the variable.
val set : 'a t -> 'a -> unit
set v x
updates the variable v
to hold the value x
. This automatically invalidates all nodes that depend directly and indirectly on v
.