Aardvark.Base.Incremental


Mod

defines functions for composing mods and managing evaluation order, etc.

Nested types and modules

TypeDescription
AbstractDirtyTrackingMod<'i, 'a>
AbstractMod<'a>
AbstractModWithFinalizer<'a>
LazyMod<'a>

Functions and values

Function or valueDescription
always m
Signature: m:IMod<'a> -> IMod<'a>
Type parameters: 'a
async a
Signature: a:Async<'a> -> IMod<Option<'a>>
Type parameters: 'a

creates a new cell by starting the given async computation. until the computation is completed the cell will contain None. as soon as the computation is finished it will contain the resulting value.

asyncTask task
Signature: task:Task<'a> -> IMod<Option<'a>>
Type parameters: 'a

creates a new cell by starting the given async computation. until the computation is completed the cell will contain None. as soon as the computation is finished it will contain the resulting value.

asyncWithDefault defaultValue a
Signature: defaultValue:'a -> a:Async<'a> -> IMod<'a>
Type parameters: 'a

creates a new cell by starting the given async computation. until the computation is completed the cell will contain the default value. as soon as the computation is finished it will contain the resulting value.

bind f m
Signature: f:('a -> 'c) -> m:IMod<'a> -> IMod<'b>
Type parameters: 'a, 'c, 'b

adaptively applies a function to a cell's value and returns a new dependent cell holding the inner cell's content.

bind2 f ma mb
Signature: f:('a -> 'b -> 'd) -> ma:IMod<'a> -> mb:IMod<'b> -> IMod<'c>
Type parameters: 'a, 'b, 'd, 'c

adaptively applies a function to two cell's values and returns a new dependent cell holding the inner cell's content.

cast m
Signature: m:IMod -> IMod<'b>
Type parameters: 'b

adaptively casts a value to the desired type and fails if the cast is invalid. NOTE that this does not create a new cell but instead "decorates" the given cell.

change m value
Signature: m:IModRef<'a> -> value:'a -> unit
Type parameters: 'a

changes the value of the given cell. Note that this function may only be used inside a current transaction.

changeAfterEvaluation m value
Signature: m:IModRef<'a> -> value:'a -> unit
Type parameters: 'a

changes the value of the given cell after the current evaluation phase has finished

constant v
Signature: v:'a -> IMod<'a>
Type parameters: 'a

initializes a new constant cell using the given value.

custom compute
Signature: compute:(AdaptiveToken -> 'a) -> IMod<'a>
Type parameters: 'a

creates a custom modifiable cell using the given compute function. If no inputs are added to the cell it will actually be constant. However the system will not statically assume the cell to be constant in any case.

delay f
Signature: f:(unit -> 'a) -> IMod<'a>
Type parameters: 'a

initializes a new constant cell using the given lazy value.

dynamic f
Signature: f:(unit -> IMod<'a>) -> IMod<'a>
Type parameters: 'a

creates a dynamic cell using the given function while maintaining lazy evaluation.

force m
Signature: m:IMod<'a> -> 'a
Type parameters: 'a

forces the evaluation of a cell and returns its current value

init v
Signature: v:'a -> ModRef<'a>
Type parameters: 'a

initializes a new modifiable input cell using the given value.

initConstant v
Signature: v:'a -> IMod<'a>
Type parameters: 'a
initDefault initial
Signature: initial:IMod<'a> -> DefaultingModRef<'a>
Type parameters: 'a

see DefaultingModRef

initialize ()
Signature: unit -> unit
initMod v
Signature: v:'a -> ModRef<'a>
Type parameters: 'a
later m
Signature: m:IMod<'a> -> IMod<'a>
Type parameters: 'a
lazyAsync run
Signature: run:Async<'a> -> IMod<Option<'a>>
Type parameters: 'a

creates a new cell starting the given async computation when a value is requested for the first time. until the computation is completed the cell will contain None. as soon as the computation is finished it will contain the resulting value.

lazyAsyncWithDefault defaultValue run
Signature: defaultValue:'a -> run:Async<'a> -> IMod<'a>
Type parameters: 'a

creates a new cell starting the given async computation when a value is requested for the first time. until the computation is completed the cell will contain the default value. as soon as the computation is finished it will contain the resulting value.

map f m
Signature: f:('a -> 'b) -> m:IMod<'a> -> IMod<'b>
Type parameters: 'a, 'b

adaptively applies a function to a cell's value resulting in a new dependent cell.

map2 f m1 m2
Signature: f:('a -> 'b -> 'c) -> m1:IMod<'a> -> m2:IMod<'b> -> IMod<'c>
Type parameters: 'a, 'b, 'c

adaptively applies a function to two cell's values resulting in a new dependent cell.

mapCustom f inputs
Signature: f:(AdaptiveToken -> 'a) -> inputs:'c list -> IMod<'a>
Type parameters: 'a, 'c

creates a custom modifiable cell using the given compute function and adds all given inputs to the resulting cell.

mapFast f m
Signature: f:('a -> 'b) -> m:IMod<'a> -> IMod<'b>
Type parameters: 'a, 'b

adaptively applies a function to a cell's value without creating a new cell (maintaining equality, id, etc.) NOTE: this combinator assumes that the given function is really cheap (e.g. field-access, cast, etc.)

mapFastObj f m
Signature: f:(obj -> 'b) -> m:IMod -> IMod<'b>
Type parameters: 'b

adaptively applies a function to a cell's value without creating a new cell (maintaining equality, id, etc.) NOTE: this combinator assumes that the given function is really cheap (e.g. field-access, cast, etc.)

mapN f inputs
Signature: f:(seq<'a> -> 'b) -> inputs:seq<'c> -> IMod<'b>
Type parameters: 'a, 'b, 'c

creates a modifiable cell using the given inputs and compute function (being evaluated whenever any of the inputs changes.

onPull m
Signature: m:IMod<'a> -> IMod<'a>
Type parameters: 'a

creates a new cell forcing the evaluation of the given one to be lazy (on demand) NOTE: onPull does not maintain equality for constant-cells

onPush m
Signature: m:IMod<'a> -> IMod<'a>
Type parameters: 'a

creates a new cell forcing the evaluation of the given one during change propagation (making it eager)

onPushCustomEq eq m
Signature: eq:('a -> 'a -> bool) -> m:IMod<'a> -> IMod<'a>
Type parameters: 'a

creates a new cell forcing the evaluation of the given one during change propagation (making it eager) using a

registerCallback f m
Signature: f:('?12052 -> unit) -> m:IMod<'?12052> -> IDisposable
Type parameters: '?12052
start run
Signature: run:Async<'a> -> IMod<'a>
Type parameters: 'a

creates a new cell by starting the given async computation. upon evaluation of the cell it will wait until the async computation has finished

time
Signature: IMod<DateTime>

a changeable cell which will always be outdated when control-flow leaves the mod-system. Its value will always hold the current time (DateTime.Now)

unsafeRegisterCallbackKeepDisposable f m
Signature: f:('b -> unit) -> m:IMod<'b> -> IDisposable
Type parameters: 'b

registers a callback for execution whenever the set's value might have changed and returns a disposable subscription in order to unregister the callback. Note that the callback will be executed immediately once here. In contrast to registerCallbackNoGcRoot, this function holds on to the fresh disposable, i.e. even if the input set goes out of scope, the disposable still forces the complete computation to exist. When disposing the assosciated disposable, the gc root disappears and the computation can be collected.

unsafeRegisterCallbackNoGcRoot f m
Signature: f:('a -> unit) -> m:IMod<'a> -> IDisposable
Type parameters: 'a

registers a callback for execution whenever the cells value might have changed and returns a disposable subscription in order to unregister the callback. Note that the callback will be executed immediately once here. Note that this function does not hold on to the created disposable, i.e. if the disposable as well as the source dies, the callback dies as well. If you use callbacks to propagate changed to other mods by using side-effects (which you should not do), use registerCallbackKeepDisposable in order to create a gc to the fresh disposable. registerCallbackKeepDisposable only destroys the callback, iff the associated disposable is disposed.

useCurrent f
Signature: f:(AdaptiveToken -> 'a) -> IMod<'a>
Type parameters: 'a
Fork me on GitHub