Module Bonsai_proc.ValueSource

Sourcetype 'a t = 'a Cont.t

A value of type 'a Value.t represents a value that may change during the lifetime of the program. For those familiar with the Incremental library, this type is conceptually very similar to Incr.t. The main method by which you acquire values of type Value.t is by using the let%sub syntax extension.

  val c : int Computation.t

  let%sub x = c in
  (* [x] has type [int Value.t] here *)

In the example above, we run a computation c and store the result of that computation in x which has type Value.t.

Value.t is an applicative, which means that you can combine multiple Values into one by using Let_syntax:

  val a : int Value.t
  val b : int Value.t

  let open Let_syntax in
  let%map a = a and b = b in
  a + b
include Bonsai_private_base.Applicative.S with type 'a t := 'a t
Sourceval return : here:lexing_position -> 'a -> 'a t
Sourceval map : here:lexing_position -> 'a t -> f:('a -> 'b) -> 'b t
Sourceval both : here:lexing_position -> 'a t -> 'b t -> ('a * 'b) t
Sourceval (<*>) : here:lexing_position -> ('a -> 'b) t -> 'a t -> 'b t
Sourceval (<*) : here:lexing_position -> 'a t -> Base.unit t -> 'a t
Sourceval (*>) : here:lexing_position -> Base.unit t -> 'a t -> 'a t
Sourceval (>>|) : here:lexing_position -> 'a t -> ('a -> 'b) -> 'b t
Sourceval apply : here:lexing_position -> ('a -> 'b) t -> 'a t -> 'b t
Sourceval map2 : here:lexing_position -> 'a t -> 'b t -> f:('a -> 'b -> 'c) -> 'c t
Sourceval all : here:lexing_position -> 'a t Base.list -> 'a Base.list t
Sourceval all_unit : here:lexing_position -> Base.unit t Base.list -> Base.unit t
Sourcemodule Applicative_infix : sig ... end
include Bonsai_private_base.Import.Mapn with type 'a t := 'a t
Sourceval map3 : here:lexing_position -> 'a1 t -> 'a2 t -> 'a3 t -> f:('a1 -> 'a2 -> 'a3 -> 'b) -> 'b t
Sourceval map4 : here:lexing_position -> 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> f:('a1 -> 'a2 -> 'a3 -> 'a4 -> 'b) -> 'b t
Sourceval map5 : here:lexing_position -> 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> 'a5 t -> f:('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'b) -> 'b t
Sourceval map6 : here:lexing_position -> 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> 'a5 t -> 'a6 t -> f:('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'a6 -> 'b) -> 'b t
Sourceval map7 : here:lexing_position -> 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> 'a5 t -> 'a6 t -> 'a7 t -> f:('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'a6 -> 'a7 -> 'b) -> 'b t
Sourceval cutoff : here:lexing_position -> 'a t -> equal:('a -> 'a -> bool) -> 'a t

A Value.t transformed by cutoff will only trigger changes on its dependents when the equality of the contained value has changed.

Immediate nesting of cutoff nodes are combined into a single cutoff node whose equality function is true when any of the composed nodes is true and is false when all of the composed nodes are false. They're "or'ed together".

Sourceval transpose_opt : 'a t option -> 'a option t

flips the option position in a 'a Value.t option into an 'a option Value.t. It's useful for optional args that take values.