package par_incr

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

Defines the type and various operations for modifiable values.

type 'a t

A 'a Var.t will hold a value of type 'a. Unlike 'a t, this can be read and changed. This is our handle to values that can be mutated and the computations can then be propagated efficiently.

val create : ?cutoff:'a Cutoff.t -> ?to_s:('a -> string) -> 'a -> 'a t

Var.create x creates a Var.t with value x. Optionally you can specify cutoff and to_s parameters as well. Default for cutoff is Phys_equal and it's recommended to pass cutoff wherever the default doesn't work.

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

Var.set t x sets the value of t to x. In case x is same as the old value, it won't do anything. If x is not equal to the old value, it'll mark all the computations that depend on t to be ready for propagation.

val value : 'a t -> 'a

Var.value t returns the value stored inside t.

val watch : 'a t -> 'a incremental

Var.value t converts 'a Var.t to 'a incremental. This is what lets us apply many combinators made available by the library and write bigger incremental programs.

module Syntax : sig ... end

Syntax module introduces some convenient operators for Var.set and Var.value operations.

OCaml

Innovation. Community. Security.