Table of Contents

Class SignalExtensions

Namespace
Virtufin.Core.Behaviour
Assembly
Virtufin.Core.dll

Pure combinators over ISignal<T> — the map/zip rows of the domain spec's stream algebra (§10.4), specialised to a single current value rather than a stream. Each result wraps its source(s) lazily: reading Value re-evaluates from the source's current value at read time, so there is no cached/stale copy to keep in sync as the source changes.

public static class SignalExtensions
Inheritance
SignalExtensions
Inherited Members

Methods

Combine<TA, TB, TResult>(ISignal<TA>, ISignal<TB>, Func<TA, TB, TResult>)

Derive a signal from two signals' current values.

public static ISignal<TResult> Combine<TA, TB, TResult>(this ISignal<TA> left, ISignal<TB> right, Func<TA, TB, TResult> f)

Parameters

left ISignal<TA>

The left source signal.

right ISignal<TB>

The right source signal.

f Func<TA, TB, TResult>

Pure function combining both current values.

Returns

ISignal<TResult>

Type Parameters

TA

The left source signal's value type.

TB

The right source signal's value type.

TResult

The derived signal's value type.

Remarks

Realises the zip combinator (§10.4) at the signal level.

Map<T, TResult>(ISignal<T>, Func<T, TResult>)

Derive a signal by applying a pure function to another signal's current value.

public static ISignal<TResult> Map<T, TResult>(this ISignal<T> signal, Func<T, TResult> f)

Parameters

signal ISignal<T>

The source signal.

f Func<T, TResult>

Pure function from the source value to the derived value.

Returns

ISignal<TResult>

Type Parameters

T

The source signal's value type.

TResult

The derived signal's value type.

Remarks

Realises the map combinator (§10.4) at the signal level.