Contents
- Source <A>
- Empty
- Reduce <S> (S state, Func<S, A, S> reducer)
- Reduce <S> (S state, Reducer<A, S> reducer)
- ReduceAsync <S> (S state, ReducerAsync<A, S> reducer)
- ReduceAsync <M, S> (S state, ReducerAsync<A, S> reducer)
- Transform <B> (Transducer<A, B> transducer)
- Map <B> (Func<A, B> f)
- Bind <B> (Func<A, Source<B>> f)
- Bind <B> (Func<A, K<Source, B>> f)
- Where (Func<A, bool> f)
- Filter (Func<A, bool> f)
- ApplyBack <B> (Source<Func<A, B>> ff)
- Combine (Source<A> rhs)
- Choose (Source<A> rhs)
- Zip <B> (Source<B> second)
- Zip <B, C> (Source<B> second, Source<C> third)
- Zip <B, C, D> (Source<B> second, Source<C> third, Source<D> fourth)
- Skip (int amount)
- Take (int amount)
- Fold <S> (Func<S, A, S> Fold, S Init)
- Fold <S> (Schedule Time, Func<S, A, S> Fold, S Init)
- FoldWhile <S> (Func<S, A, S> Fold, Func<S, A, bool> Pred, S Init)
- FoldUntil <S> (Func<S, A, S> Fold, Func<S, A, bool> Pred, S Init)
- FoldWhile <S> ( Schedule Time, Func<S, A, S> Fold, Func<S, A, bool> Pred, S Init)
- FoldUntil <S> ( Schedule Time, Func<S, A, S> Fold, Func<S, A, bool> Pred, S Init)
- ToProducerT <M> ()
- ToProducer <RT> ()
- + (Source<A> lhs, Source<A> rhs)
- | (Source<A> lhs, Source<A> rhs)
- >> (Source<A> lhs, Source<A> rhs)
- >> (Source<A> lhs, K<Source, A> rhs)
- >> (Source<A> lhs, Source<Unit> rhs)
- >> (Source<A> lhs, K<Source, Unit> rhs)
- Select <B> (Func<A, B> f)
- SelectMany <B, C> (Func<A, Source<B>> bind, Func<A, B, C> project)
- SourceExtensions
- As <A> (this K<Source, A> ma)
- AsSource <A> (this Channel<A> items)
- AsSource <A> (this IEnumerable<A> items)
- AsSource <A> (this IAsyncEnumerable<A> items)
- Iter <A> (this K<Source, A> ma)
- Iter <M, A> (this K<Source, A> ma)
- Last <A> (this K<Source, A> ma)
- Last <M, A> (this K<Source, A> ma)
- Collect <A> (this K<Source, A> ma)
- Collect <M, A> (this K<Source, A> ma)
- Source
- empty <A> ()
- pure <A> (A value)
- forever <A> (A value)
- lift <A> (Channel<A> channel)
- lift <A> (IEnumerable<A> items)
- lift <A> (IAsyncEnumerable<A> items)
- merge <A> (Seq<Source<A>> sources)
- merge <A> (params Source<A>[] sources)
- zip <A, B> (Source<A> first, Source<B> second)
- zip <A, B, C> (Source<A> first, Source<B> second, Source<C> third)
- zip <A, B, C, D> (Source<A> first, Source<B> second, Source<C> third, Source<D> fourth)
- Source
Sub modules
DSL |
A source / stream of values
Parameters
type | A | Bound value type |
Methods
method IO<S> Reduce <S> (S state, Func<S, A, S> reducer) Source #
Iterate the stream, flowing values downstream to the reducer, which aggregates a result value.
Parameters
type | S | State type |
param | state | State to reduce |
param | reducer | Reducer |
returns | Reduced state |
method IO<S> Reduce <S> (S state, Reducer<A, S> reducer) Source #
Iterate the stream, flowing values downstream to the reducer, which aggregates a result value.
Parameters
type | S | State type |
param | state | State to reduce |
param | reducer | Reducer |
returns | Reduced state |
method IO<S> ReduceAsync <S> (S state, ReducerAsync<A, S> reducer) Source #
Iterate the stream, flowing values downstream to the reducer, which aggregates a result value.
Parameters
type | S | State type |
param | state | State to reduce |
param | reducer | Reducer |
returns | Reduced state |
method K<M, S> ReduceAsync <M, S> (S state, ReducerAsync<A, S> reducer) Source #
Iterate the stream, flowing values downstream to the reducer, which aggregates a result value.
Parameters
type | S | State type |
param | state | State to reduce |
param | reducer | Reducer |
returns | Reduced state |
method Source<B> Transform <B> (Transducer<A, B> transducer) Source #
Transform with a transducer
Parameters
type | B | Target bound value type |
param | transducer | Transducer to use to transform |
returns | Transformed source |
method Source<A> Where (Func<A, bool> f) Source #
Filter values. Yielding downstream when true
Parameters
param | f | Filter function |
returns | Source where the only values yield are those that pass the predicate |
method Source<A> Filter (Func<A, bool> f) Source #
Filter values. Yielding downstream when true
Parameters
param | f | Filter function |
returns | Source where the only values yield are those that pass the predicate |
method Source<A> Combine (Source<A> rhs) Source #
Concatenate two sources into a single source.
Parameters
param | lhs | Left-hand side |
param | rhs | Right-hand side |
returns | Concatenated stream of values |
method Source<A> Choose (Source<A> rhs) Source #
The value streams are both merged into a new stream. Values are yielded as they become available.
Parameters
param | this | Left-hand side |
param | rhs | Right-hand side |
returns | Merged stream |
method Source<(A First, B Second)> Zip <B> (Source<B> second) Source #
Zip two sources into one
Parameters
type | B | Bound value-type of the stream to zip with this one |
param | second | Stream to zip with this one |
returns | Stream of values where the items from two streams are paired together |
method Source<(A First, B Second, C Third)> Zip <B, C> (Source<B> second, Source<C> third) Source #
Zip three sources into one
Parameters
type | B | Bound value-type of the stream to zip with this one |
param | second | Stream to zip with this one |
param | third | Stream to zip with this one |
returns | Stream of values where the items from two streams are paired together |
method Source<(A First, B Second, C Third, D Fourth)> Zip <B, C, D> (Source<B> second, Source<C> third, Source<D> fourth) Source #
Zip three sources into one
Parameters
type | B | Bound value-type of the stream to zip with this one |
param | second | Stream to zip with this one |
param | third | Stream to zip with this one |
param | fourth | Stream to zip with this one |
returns | Stream of values where the items from two streams are paired together |
method Source<A> Skip (int amount) Source #
Skip items in the source
Parameters
param | amount | Amount to skip |
returns | Transformed source |
method Source<A> Take (int amount) Source #
Limit the number of items processed
Parameters
param | amount | Amount to take |
returns | Transformed source |
method Source<S> Fold <S> (Func<S, A, S> Fold, S Init) Source #
Fold the values flowing through. A value is only yielded downstream upon completion of the stream.
Parameters
type | S | State type |
param | Fold | Binary operator |
param | Init | Initial state |
returns | Stream of aggregate state |
method Source<S> Fold <S> (Schedule Time, Func<S, A, S> Fold, S Init) Source #
Fold the values flowing through. Values are yielded downstream when either the schedule expires, or the source completes.
Parameters
type | S | State type |
param | Time | Schedule to control the rate of processing |
param | Fold | Binary operator |
param | Init | Initial state |
returns | Stream of aggregate states |
method Source<S> FoldWhile <S> (Func<S, A, S> Fold, Func<S, A, bool> Pred, S Init) Source #
Fold the values flowing through. Values are yielded downstream when either the predicate returns
false
, or the source completes.
Parameters
type | S | State type |
param | Fold | Binary operator |
param | Pred | Predicate |
param | Init | Initial state |
returns | Stream of aggregate states |
method Source<S> FoldUntil <S> (Func<S, A, S> Fold, Func<S, A, bool> Pred, S Init) Source #
Fold the values flowing through. Values are yielded downstream when either the predicate returns
true
, or the source completes.
Parameters
type | S | State type |
param | Fold | Binary operator |
param | Pred | Predicate |
param | Init | Initial state |
returns | Stream of aggregate states |
method Source<S> FoldWhile <S> ( Schedule Time, Func<S, A, S> Fold, Func<S, A, bool> Pred, S Init) Source #
Fold the values flowing through. Values are yielded downstream when either the schedule expires, the
predicate returns false
, or the source completes.
Parameters
type | S | State type |
param | Time | Schedule to control the rate of processing |
param | Fold | Binary operator |
param | Pred | Predicate |
param | Init | Initial state |
returns | Stream of aggregate states |
method Source<S> FoldUntil <S> ( Schedule Time, Func<S, A, S> Fold, Func<S, A, bool> Pred, S Init) Source #
Fold the values flowing through. Values are yielded downstream when either the schedule expires, the
predicate returns true
, or the source completes.
Parameters
type | S | |
param | Time | Schedule to control the rate of processing |
param | Fold | Binary operator |
param | Pred | Predicate |
param | Init | Initial state |
returns | Stream of aggregate states |
method ProducerT<A, M, Unit> ToProducerT <M> () Source #
Convert Source
to a ProducerT
pipe component
Parameters
type | M | Monad to lift (must support |
returns |
|
method Producer<RT, A, Unit> ToProducer <RT> () Source #
Convert Source
to a Producer
pipe component
Parameters
returns |
|
method Source<C> SelectMany <B, C> (Func<A, Source<B>> bind, Func<A, B, C> project) Source #
Monad bind
Operators
operator + (Source<A> lhs, Source<A> rhs) Source #
Concatenate two sources into a single source.
Parameters
param | lhs | Left-hand side |
param | rhs | Right-hand side |
returns | Concatenated stream of values |
operator | (Source<A> lhs, Source<A> rhs) Source #
The value streams are both merged into a new stream. Values are yielded as they become available.
Parameters
param | lhs | Left-hand side |
param | rhs | Right-hand side |
returns | Merged stream |
operator >> (Source<A> lhs, Source<A> rhs) Source #
Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in C#.
Parameters
param | lhs | First action to run |
param | rhs | Second action to run |
returns | Result of the second action |
operator >> (Source<A> lhs, K<Source, A> rhs) Source #
Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in C#.
Parameters
param | lhs | First action to run |
param | rhs | Second action to run |
returns | Result of the second action |
class SourceExtensions Source #
Methods
method IO<Unit> Iter <A> (this K<Source, A> ma) Source #
Force iteration of the stream, yielding a unit M
structure.
The expectation is that the stream uses IO
for side effects, so this makes them to happen.
method K<M, Unit> Iter <M, A> (this K<Source, A> ma) Source #
Force iteration of the stream, yielding a unit M
structure.
The expectation is that the stream uses IO
for side effects, so this makes them to happen.
method IO<A> Last <A> (this K<Source, A> ma) Source #
Force iteration of the stream, yielding the last structure processed
method K<M, A> Last <M, A> (this K<Source, A> ma) Source #
Force iteration of the stream, yielding the last structure processed
Methods
method Source<A> empty <A> () Source #
Empty source
This is a 'void' source, it yields zero values.
Parameters
type | A | Bound value type |
returns | Uninhabited source |
method Source<A> pure <A> (A value) Source #
Lift a pure value into the source
This is a singleton/unit source, it yields exactly one value.
Parameters
type | A | Bound value type |
param | value | Value to lift |
returns | Singleton source |
method Source<A> forever <A> (A value) Source #
Lift a pure value into the source and yield it for infinity
This is an infinite source, it repeatedly yields a value.
Parameters
type | A | Bound value type |
param | value | Value to lift |
returns | Infinite source |
method Source<A> lift <A> (Channel<A> channel) Source #
Make a System.Threading.Channels.Channel
into a source of values
Parameters
type | A | Value type |
param | channel | Channel to lift |
returns | Source of values |
method Source<A> lift <A> (IEnumerable<A> items) Source #
Make an IEnumerable
into a source of values
Parameters
type | A | Value type |
param | items | Enumerable to lift |
returns | Source of values |
method Source<A> lift <A> (IAsyncEnumerable<A> items) Source #
Make an IEnumerable
into a source of values
Parameters
type | A | Value type |
param | items | Enumerable to lift |
returns | Source of values |
method Source<A> merge <A> (Seq<Source<A>> sources) Source #
Merge sources into a single source
Parameters
type | A | Bound value type |
param | sources | Sources |
returns | Source that is the combination of all provided sources |
method Source<A> merge <A> (params Source<A>[] sources) Source #
Merge sources into a single source
Parameters
type | A | Bound value type |
param | sources | Sources |
returns | Source that is the combination of all provided sources |
method Source<(A First, B Second)> zip <A, B> (Source<A> first, Source<B> second) Source #
Zip two sources into one
Parameters
type | B | Bound value type of the stream to zip with this one |
param | second | Stream to zip with this one |
returns | Stream of values where the items from two streams are paired together |
method Source<(A First, B Second, C Third)> zip <A, B, C> (Source<A> first, Source<B> second, Source<C> third) Source #
Zip three sources into one
Parameters
type | B | Bound value type of the stream to zip with this one |
param | second | Stream to zip with this one |
param | third | Stream to zip with this one |
returns | Stream of values where the items from two streams are paired together |
method Source<(A First, B Second, C Third, D Fourth)> zip <A, B, C, D> (Source<A> first, Source<B> second, Source<C> third, Source<D> fourth) Source #
Zip three sources into one
Parameters
type | B | Bound value type of the stream to zip with this one |
param | second | Stream to zip with this one |
param | third | Stream to zip with this one |
param | fourth | Stream to zip with this one |
returns | Stream of values where the items from two streams are paired together |