Bonsai.ValueSourceA 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 + binclude Core.Applicative.S with type 'a t := 'a tval return : 'a -> 'a tmodule Applicative_infix : sig ... end