Class StreamExtensionMethods
- Namespace
- SodaFlow
- Assembly
- SodaFlow.dll
The operations available on a Stream<T>.
[PublicAPI]
public static class StreamExtensionMethods
- Inheritance
-
StreamExtensionMethods
- Inherited Members
Remarks
A stream is a sequence of discrete firings. These are extension methods rather than instance members, thus the combinators live out of the small assembly that holds the FRP engine. The effect at the call site is the same. Build the graph in a Run<T>(Func<T>), thus the listener gets the first firing.
Methods
- AccumLazy<T, TReturn>(Stream<T>, Lazy<TReturn>, Func<T, TReturn, TReturn>)
Accumulate on this stream, outputting the new state each time an event fires using a lazily evaluated initial state.
- Accum<T, TReturn>(Stream<T>, TReturn, Func<T, TReturn, TReturn>)
Accumulate on this stream, outputting the new state each time an event fires.
- Calm<T>(Stream<T>)
Return a stream that only outputs events which have a different value than the previous event.
- Calm<T>(Stream<T>, IEqualityComparer<T>)
Return a stream that only outputs events which have a different value than the previous event.
- Calm<T>(Stream<T>, Func<T, T, bool>)
Return a stream that only outputs events which have a different value than the previous event.
- Choose<T, TResult>(Stream<T>, Func<T, Maybe<TResult>>)
Transform the stream values with a function which can give no value, and fire only the values it gives.
- CollectLazy<T, TState, TReturn>(Stream<T>, Lazy<TState>, Func<T, TState, (TReturn ReturnValue, TState State)>)
Transform a stream with a generalized state loop (a Mealy machine) using a lazily evaluated initial state. This calls the function with the input and the previous state, and the function returns the new state and the output value.
- Collect<T, TState, TReturn>(Stream<T>, TState, Func<T, TState, (TReturn ReturnValue, TState State)>)
Transform a stream with a generalized state loop (a Mealy machine). This calls the function with the input and the previous state, and the function returns the new state and the output value.
- Debounce<T, TTime>(Stream<T>, ITimerSystem<TTime>, Func<TTime, TTime>)
Fires the last value after a time with no other value. Each firing moves the alarm out, thus a sequence of firings with no space between them gives one value.
- FilterSome<T>(Stream<Maybe<T>>)
Return a stream that only outputs events that have values, removing the Maybe<T> wrapper, and discarding None values.
- Filter<T>(Stream<T>, Func<T, bool>)
Return a stream that only outputs events for which the predicate returns <pre><code class="lang-csharp">true</code></pre>.
- Gate<T>(Stream<T>, Behavior<bool>)
Return a stream that only outputs events from the input stream when the specified behavior's value is
true.
- Gate<T>(Stream<T>, Cell<bool>)
Return a stream that only outputs events from the input stream when the specified cell's value is <pre><code class="lang-csharp">true</code></pre>.
- HoldLazy<T>(Stream<T>, Lazy<T>)
Makes a cell with the given lazy initial value, and the values of this stream update it.
- Hold<T>(Stream<T>, T)
Makes a cell with the given initial value, and the values of this stream update it.
- ListenOnceAsync<T>(Stream<T>)
Handle the first event on this stream and then automatically unregister.
- ListenOnceAsync<T>(Stream<T>, CancellationToken)
Handle the first event on this stream and then automatically unregister.
- ListenOnceStrong<T>(Stream<T>, Action<T>)
Handle the first event on this stream and then automatically unregister, keeping the stream alive until that first event arrives.
- ListenOnce<T>(Stream<T>, Action<T>)
Handle the first event on this stream and then automatically unregister, without keeping the stream alive.
- ListenStrong<T>(Stream<T>, Action<T>)
Listen for events/firings on this stream, keeping the stream alive for as long as the returned listener is reachable. A disposal of the IStrongListener from this call stops the listener. This is an OPERATIONAL mechanism for the boundary between the world of I/O and FRP.
- Listen<T>(Stream<T>, Action<T>)
Listen for events/firings on this stream, without keeping the stream alive. The returned IWeakListener. A call to Unlisten() stops the listener, and the listener also stops when a GC collects it. This is an OPERATIONAL mechanism for interfacing between the world of I/O and FRP.
- MapTo<T, TResult>(Stream<T>, TResult)
Transform the stream values to the specified constant value.
- Map<T, TResult>(Stream<T>, Func<T, TResult>)
Transforms the values of a stream with the given function. The stream from this call has the value of that function on the value of the input stream.
- Merge<T>(Stream<T>, Stream<T>, Func<T, T, T>)
Merges two streams of the same type into one. An event value on one input goes to the stream from this call.
- Merge<T>(IEnumerable<Stream<T>>, Func<T, T, T>)
Merges a collection of streams of the same type into one. An event on each input goes to the stream from this call.
- Merge<T, T2>(Stream<T>, Stream<T2>)
Merges this stream with a stream of a different type. The stream from this call fires in each transaction in which one or more of the streams fire.
- Merge<T, T2, T3>(Stream<T>, Stream<T2>, Stream<T3>)
Merges this stream with two streams of other types. The stream from this call fires in each transaction in which one or more of the three streams fire.
- Merge<T, T2, T3, T4>(Stream<T>, Stream<T2>, Stream<T3>, Stream<T4>)
Merges this stream with three streams of other types. The stream from this call fires in each transaction in which one or more of the four streams fire.
- Merge<T, T2, T3, T4, T5>(Stream<T>, Stream<T2>, Stream<T3>, Stream<T4>, Stream<T5>)
Merges this stream with four streams of other types. The stream from this call fires in each transaction in which one or more of the five streams fire.
- Merge<T, T2, T3, T4, T5, T6>(Stream<T>, Stream<T2>, Stream<T3>, Stream<T4>, Stream<T5>, Stream<T6>)
Merges this stream with five streams of other types. The stream from this call fires in each transaction in which one or more of the six streams fire.
- Merge<T, T2, T3, T4, T5, T6, T7>(Stream<T>, Stream<T2>, Stream<T3>, Stream<T4>, Stream<T5>, Stream<T6>, Stream<T7>)
Merges this stream with six streams of other types. The stream from this call fires in each transaction in which one or more of the seven streams fire.
- Merge<T, T2, T3, T4, T5, T6, T7, T8>(Stream<T>, Stream<T2>, Stream<T3>, Stream<T4>, Stream<T5>, Stream<T6>, Stream<T7>, Stream<T8>)
Merges this stream with seven streams of other types. The stream from this call fires in each transaction in which one or more of the eight streams fire.
- Once<T>(Stream<T>)
Return a stream that outputs only one value: the next event of the input stream starting from the transaction of this call.
- OrElse<T>(Stream<T>, Stream<T>)
Merges this stream with a second stream and drops the value of the second stream when they are simultaneous.
- OrElse<T>(IEnumerable<Stream<T>>)
Merges a collection of streams and drops the value of the stream earlier in the collection when they are simultaneous.
- SnapshotLatest<T, T1, T2, T3, T4, T5, T6, T7, T8, TResult>(Stream<T>, Behavior<T1>, Behavior<T2>, Behavior<T3>, Behavior<T4>, Behavior<T5>, Behavior<T6>, Behavior<T7>, Behavior<T8>, Func<T, T1, T2, T3, T4, T5, T6, T7, T8, TResult>)
Gives a stream that fires the result of the given function on the fired value and the latest values of the behaviors.
- SnapshotLatest<T, T1, T2, T3, T4, T5, T6, T7, T8, TResult>(Stream<T>, Cell<T1>, Cell<T2>, Cell<T3>, Cell<T4>, Cell<T5>, Cell<T6>, Cell<T7>, Cell<T8>, Func<T, T1, T2, T3, T4, T5, T6, T7, T8, TResult>)
Gives a stream that fires the result of the given function on the fired value and the latest values of the cells.
- SnapshotLatest<T, TResult>(Stream<T>, Behavior<TResult>)
Gives a stream that fires the latest value of the behavior at the moment of each firing.
- SnapshotLatest<T, TResult>(Stream<T>, Cell<TResult>)
Gives a stream that fires the latest value of the cell at the moment of each firing.
- SnapshotLatest<T, T1, TResult>(Stream<T>, Behavior<T1>, Func<T, T1, TResult>)
Gives a stream that fires the result of the given function on the fired value and the latest value of the behavior.
- SnapshotLatest<T, T1, TResult>(Stream<T>, Cell<T1>, Func<T, T1, TResult>)
Gives a stream that fires the result of the given function on the fired value and the latest value of the cell.
- SnapshotLatest<T, T1, T2, TResult>(Stream<T>, Behavior<T1>, Behavior<T2>, Func<T, T1, T2, TResult>)
Gives a stream that fires the result of the given function on the fired value and the latest values of the behaviors.
- SnapshotLatest<T, T1, T2, TResult>(Stream<T>, Cell<T1>, Cell<T2>, Func<T, T1, T2, TResult>)
Gives a stream that fires the result of the given function on the fired value and the latest values of the cells.
- SnapshotLatest<T, T1, T2, T3, TResult>(Stream<T>, Behavior<T1>, Behavior<T2>, Behavior<T3>, Func<T, T1, T2, T3, TResult>)
Gives a stream that fires the result of the given function on the fired value and the latest values of the behaviors.
- SnapshotLatest<T, T1, T2, T3, TResult>(Stream<T>, Cell<T1>, Cell<T2>, Cell<T3>, Func<T, T1, T2, T3, TResult>)
Gives a stream that fires the result of the given function on the fired value and the latest values of the cells.
- SnapshotLatest<T, T1, T2, T3, T4, TResult>(Stream<T>, Behavior<T1>, Behavior<T2>, Behavior<T3>, Behavior<T4>, Func<T, T1, T2, T3, T4, TResult>)
Gives a stream that fires the result of the given function on the fired value and the latest values of the behaviors.
- SnapshotLatest<T, T1, T2, T3, T4, TResult>(Stream<T>, Cell<T1>, Cell<T2>, Cell<T3>, Cell<T4>, Func<T, T1, T2, T3, T4, TResult>)
Gives a stream that fires the result of the given function on the fired value and the latest values of the cells.
- SnapshotLatest<T, T1, T2, T3, T4, T5, TResult>(Stream<T>, Behavior<T1>, Behavior<T2>, Behavior<T3>, Behavior<T4>, Behavior<T5>, Func<T, T1, T2, T3, T4, T5, TResult>)
Gives a stream that fires the result of the given function on the fired value and the latest values of the behaviors.
- SnapshotLatest<T, T1, T2, T3, T4, T5, TResult>(Stream<T>, Cell<T1>, Cell<T2>, Cell<T3>, Cell<T4>, Cell<T5>, Func<T, T1, T2, T3, T4, T5, TResult>)
Gives a stream that fires the result of the given function on the fired value and the latest values of the cells.
- SnapshotLatest<T, T1, T2, T3, T4, T5, T6, TResult>(Stream<T>, Behavior<T1>, Behavior<T2>, Behavior<T3>, Behavior<T4>, Behavior<T5>, Behavior<T6>, Func<T, T1, T2, T3, T4, T5, T6, TResult>)
Gives a stream that fires the result of the given function on the fired value and the latest values of the behaviors.
- SnapshotLatest<T, T1, T2, T3, T4, T5, T6, TResult>(Stream<T>, Cell<T1>, Cell<T2>, Cell<T3>, Cell<T4>, Cell<T5>, Cell<T6>, Func<T, T1, T2, T3, T4, T5, T6, TResult>)
Gives a stream that fires the result of the given function on the fired value and the latest values of the cells.
- SnapshotLatest<T, T1, T2, T3, T4, T5, T6, T7, TResult>(Stream<T>, Behavior<T1>, Behavior<T2>, Behavior<T3>, Behavior<T4>, Behavior<T5>, Behavior<T6>, Behavior<T7>, Func<T, T1, T2, T3, T4, T5, T6, T7, TResult>)
Gives a stream that fires the result of the given function on the fired value and the latest values of the behaviors.
- SnapshotLatest<T, T1, T2, T3, T4, T5, T6, T7, TResult>(Stream<T>, Cell<T1>, Cell<T2>, Cell<T3>, Cell<T4>, Cell<T5>, Cell<T6>, Cell<T7>, Func<T, T1, T2, T3, T4, T5, T6, T7, TResult>)
Gives a stream that fires the result of the given function on the fired value and the latest values of the cells.
- Snapshot<T, T1, T2, T3, T4, T5, T6, T7, T8, TResult>(Stream<T>, Behavior<T1>, Behavior<T2>, Behavior<T3>, Behavior<T4>, Behavior<T5>, Behavior<T6>, Behavior<T7>, Behavior<T8>, Func<T, T1, T2, T3, T4, T5, T6, T7, T8, TResult>)
Gives a stream that fires the result of the given function on the fired value and the values of the behaviors.
- Snapshot<T, T1, T2, T3, T4, T5, T6, T7, T8, TResult>(Stream<T>, Cell<T1>, Cell<T2>, Cell<T3>, Cell<T4>, Cell<T5>, Cell<T6>, Cell<T7>, Cell<T8>, Func<T, T1, T2, T3, T4, T5, T6, T7, T8, TResult>)
Gives a stream that fires the result of the given function on the fired value and the values of the cells.
- Snapshot<T, TResult>(Stream<T>, Behavior<TResult>)
Gives a stream that fires the value of the behavior at the moment of each firing.
- Snapshot<T, TResult>(Stream<T>, Cell<TResult>)
Gives a stream that fires the value of the cell at the moment of each firing.
- Snapshot<T, T1, TResult>(Stream<T>, Behavior<T1>, Func<T, T1, TResult>)
Gives a stream that fires the result of the given function on the fired value and the value of the behavior.
- Snapshot<T, T1, TResult>(Stream<T>, Cell<T1>, Func<T, T1, TResult>)
Gives a stream that fires the result of the given function on the fired value and the value of the cell.
- Snapshot<T, T1, T2, TResult>(Stream<T>, Behavior<T1>, Behavior<T2>, Func<T, T1, T2, TResult>)
Gives a stream that fires the result of the given function on the fired value and the values of the behaviors.
- Snapshot<T, T1, T2, TResult>(Stream<T>, Cell<T1>, Cell<T2>, Func<T, T1, T2, TResult>)
Gives a stream that fires the result of the given function on the fired value and the values of the cells.
- Snapshot<T, T1, T2, T3, TResult>(Stream<T>, Behavior<T1>, Behavior<T2>, Behavior<T3>, Func<T, T1, T2, T3, TResult>)
Gives a stream that fires the result of the given function on the fired value and the values of the behaviors.
- Snapshot<T, T1, T2, T3, TResult>(Stream<T>, Cell<T1>, Cell<T2>, Cell<T3>, Func<T, T1, T2, T3, TResult>)
Gives a stream that fires the result of the given function on the fired value and the values of the cells.
- Snapshot<T, T1, T2, T3, T4, TResult>(Stream<T>, Behavior<T1>, Behavior<T2>, Behavior<T3>, Behavior<T4>, Func<T, T1, T2, T3, T4, TResult>)
Gives a stream that fires the result of the given function on the fired value and the values of the behaviors.
- Snapshot<T, T1, T2, T3, T4, TResult>(Stream<T>, Cell<T1>, Cell<T2>, Cell<T3>, Cell<T4>, Func<T, T1, T2, T3, T4, TResult>)
Gives a stream that fires the result of the given function on the fired value and the values of the cells.
- Snapshot<T, T1, T2, T3, T4, T5, TResult>(Stream<T>, Behavior<T1>, Behavior<T2>, Behavior<T3>, Behavior<T4>, Behavior<T5>, Func<T, T1, T2, T3, T4, T5, TResult>)
Gives a stream that fires the result of the given function on the fired value and the values of the behaviors.
- Snapshot<T, T1, T2, T3, T4, T5, TResult>(Stream<T>, Cell<T1>, Cell<T2>, Cell<T3>, Cell<T4>, Cell<T5>, Func<T, T1, T2, T3, T4, T5, TResult>)
Gives a stream that fires the result of the given function on the fired value and the values of the cells.
- Snapshot<T, T1, T2, T3, T4, T5, T6, TResult>(Stream<T>, Behavior<T1>, Behavior<T2>, Behavior<T3>, Behavior<T4>, Behavior<T5>, Behavior<T6>, Func<T, T1, T2, T3, T4, T5, T6, TResult>)
Gives a stream that fires the result of the given function on the fired value and the values of the behaviors.
- Snapshot<T, T1, T2, T3, T4, T5, T6, TResult>(Stream<T>, Cell<T1>, Cell<T2>, Cell<T3>, Cell<T4>, Cell<T5>, Cell<T6>, Func<T, T1, T2, T3, T4, T5, T6, TResult>)
Gives a stream that fires the result of the given function on the fired value and the values of the cells.
- Snapshot<T, T1, T2, T3, T4, T5, T6, T7, TResult>(Stream<T>, Behavior<T1>, Behavior<T2>, Behavior<T3>, Behavior<T4>, Behavior<T5>, Behavior<T6>, Behavior<T7>, Func<T, T1, T2, T3, T4, T5, T6, T7, TResult>)
Gives a stream that fires the result of the given function on the fired value and the values of the behaviors.
- Snapshot<T, T1, T2, T3, T4, T5, T6, T7, TResult>(Stream<T>, Cell<T1>, Cell<T2>, Cell<T3>, Cell<T4>, Cell<T5>, Cell<T6>, Cell<T7>, Func<T, T1, T2, T3, T4, T5, T6, T7, TResult>)
Gives a stream that fires the result of the given function on the fired value and the values of the cells.