Class BehaviorExtensionMethods
- Namespace
- SodaFlow
- Assembly
- SodaFlow.dll
The operations available on a Behavior<T>.
[PublicAPI]
public static class BehaviorExtensionMethods
- Inheritance
-
BehaviorExtensionMethods
- Inherited Members
Remarks
A behavior is a continuously varying value. These are extension methods rather than instance members so that the combinators live out of the small assembly that holds the FRP engine. the effect at the call site is the same. See CellExtensionMethods for the corresponding operations on cells, which are behaviors that also give the stream of their changes.
Methods
- Apply<T, TResult>(Behavior<T>, Behavior<Func<T, TResult>>)
Apply a value in a behavior to a function in a behavior. This is the primitive for all function lifting.
- Lift<T>(IEnumerable<Behavior<T>>)
Lift into a collection of behaviors, so the returned behavior always reflects a list of the input behaviors' values.
- Lift<T>(IReadOnlyCollection<Behavior<T>>)
Lift into a collection of behaviors, so the returned behavior always reflects a list of the input behaviors' values.
- Lift<T, TResult>(IEnumerable<Behavior<T>>, Func<IReadOnlyList<T>, TResult>)
Lift a function into a collection of behaviors, so the returned behavior always reflects the specified function applied to the input behaviors' values.
- Lift<T, TResult>(IReadOnlyCollection<Behavior<T>>, Func<IReadOnlyList<T>, TResult>)
Lift a function into a collection of behaviors, so the returned behavior always reflects the specified function applied to the input behaviors' values.
- Lift<T, T2, TResult>(Behavior<T>, Behavior<T2>, Func<T, T2, TResult>)
Lift a binary function into behaviors, so the returned behavior always reflects the specified function applied to the input behaviors' values.
- Lift<T, T2, T3, TResult>(Behavior<T>, Behavior<T2>, Behavior<T3>, Func<T, T2, T3, TResult>)
Lift a ternary function into behaviors, so the returned behavior always reflects the specified function applied to the input behaviors' values.
- Lift<T, T2, T3, T4, TResult>(Behavior<T>, Behavior<T2>, Behavior<T3>, Behavior<T4>, Func<T, T2, T3, T4, TResult>)
Lift a quaternary function into behaviors, so the returned behavior always reflects the specified function applied to the input behaviors' values.
- Lift<T, T2, T3, T4, T5, TResult>(Behavior<T>, Behavior<T2>, Behavior<T3>, Behavior<T4>, Behavior<T5>, Func<T, T2, T3, T4, T5, TResult>)
Lift a 5-argument function into behaviors, so the returned behavior always reflects the specified function applied to the input behaviors' values.
- Lift<T, T2, T3, T4, T5, T6, TResult>(Behavior<T>, Behavior<T2>, Behavior<T3>, Behavior<T4>, Behavior<T5>, Behavior<T6>, Func<T, T2, T3, T4, T5, T6, TResult>)
Lift a 6-argument function into behaviors, so the returned behavior always reflects the specified function applied to the input behaviors' values.
- Lift<T, T2, T3, T4, T5, T6, T7, TResult>(Behavior<T>, Behavior<T2>, Behavior<T3>, Behavior<T4>, Behavior<T5>, Behavior<T6>, Behavior<T7>, Func<T, T2, T3, T4, T5, T6, T7, TResult>)
Lifts a function of seven arguments into behaviors. The behavior from this call always has the value of that function on the values of the input behaviors.
- Lift<T, T2, T3, T4, T5, T6, T7, T8, TResult>(Behavior<T>, Behavior<T2>, Behavior<T3>, Behavior<T4>, Behavior<T5>, Behavior<T6>, Behavior<T7>, Behavior<T8>, Func<T, T2, T3, T4, T5, T6, T7, T8, TResult>)
Lifts a function of eight arguments into behaviors. The behavior from this call always has the value of that function on the values of the input behaviors.
- Map<T, TResult>(Behavior<T>, Func<T, TResult>)
Transforms the values of a behavior with the given function. The behavior from this call has the value of that function on the value of the input behavior.
- SampleLazy<T>(Behavior<T>)
Sample the current value of the behavior lazily.
- Sample<T>(Behavior<T>)
Sample the current value of the behavior.
- SwitchB<T>(Behavior<Behavior<T>>)
Unwrap a behavior in a second behavior to give a time-varying behavior implementation.
- SwitchC<T>(Behavior<Cell<T>>)
Unwrap a cell in a behavior to give a time-varying cell implementation.
- SwitchS<T>(Behavior<Stream<T>>)
Unwrap a stream in a behavior to give a time-varying stream implementation. At a change to the behavior, the output stream fires the simultaneous firing, if there is one. That firing comes from the stream that the behavior held at the start of the transaction.