Contents
- SourceT <M, A>
- Reduce <S> (S state, Reducer<A, S> reducer)
- FoldReduce <S> (S state, Func<S, A, S> reducer)
- ReduceM <S> (S state, ReducerM<M, A, S> reducer)
- FoldReduceM <S> (S state, Func<S, A, K<M, S>> reducer)
- Empty
- Transform <B> (TransducerM<M, A, B> transducer)
- Map <B> (Func<A, B> f)
- Bind <B> (Func<A, SourceT<M, B>> f)
- Bind <B> (Func<A, K<SourceT<M>, B>> f)
- Bind <B> (Func<A, IO<B>> f)
- Where (Func<A, bool> f)
- Filter (Func<A, bool> f)
- ApplyBack <B> (SourceT<M, Func<A, B>> ff)
- Combine (SourceT<M, A> rhs)
- 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 State, A Value), bool> Pred, S Init)
- FoldUntil <S> (Func<S, A, S> Fold, Func<(S State, A Value), bool> Pred, S Init)
- FoldWhile <S> ( Schedule Time, Func<S, A, S> Fold, Func<(S State, A Value), bool> Pred, S Init)
- FoldUntil <S> ( Schedule Time, Func<S, A, S> Fold, Func<(S State, A Value), bool> Pred, S Init)
- ToProducerT ()
- >> (SourceT<M, A> lhs, K<SourceT<M>, Unit> rhs)
- Select <B> (Func<A, B> f)
- SelectMany <B, C> (Func<A, SourceT<M, B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, K<M, B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, IO<B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, Pure<B>> bind, Func<A, B, C> project)
- ReduceInternal <S> (S state, ReducerM<M, A, S> reducer)
- ReduceInternalM <S> (S state, ReducerM<M, K<M, A>, S> reducer)
- SourceT
- empty <M, A> ()
- pure <M, A> (A value)
- done <M> ()
- liftFoldable <F, M, A> (K<F, A> fa)
- liftFoldableM <F, M, A> (K<F, K<M, A>> fma)
- liftM <M, A> (K<M, A> ma)
- liftIO <M, A> (K<IO, A> ma)
- forever <M, A> (A value)
- foreverM <M, A> (K<M, A> ma)
- lift <M, A> (Channel<A> channel)
- liftM <M, A> (Channel<K<M, A>> channel)
- lift <M, A> (Source<A> channel)
- liftM <M, A> (Source<K<M, A>> channel)
- lift <M, A> (IEnumerable<A> items)
- liftM <M, A> (IEnumerable<K<M, A>> items)
- lift <M, A> (IObservable<A> items)
- liftM <M, A> (IObservable<K<M, A>> items)
- lift <M, A> (IAsyncEnumerable<A> items)
- liftM <M, A> (IAsyncEnumerable<K<M, A>> items)
- merge <M, A> (Seq<SourceT<M, A>> sources)
- merge <M, A> (params SourceT<M, A>[] sources)
- zip <M, A, B> (SourceT<M, A> first, SourceT<M, B> second)
- zip <M, A, B, C> (SourceT<M, A> first, SourceT<M, B> second, SourceT<M, C> third)
- zip <M, A, B, C, D> (SourceT<M, A> first, SourceT<M, B> second, SourceT<M, C> third, SourceT<M, D> fourth)
- iter <M, A> (K<SourceT<M>, A> ma)
- last <M, A> (K<SourceT<M>, A> ma)
- collectWhile <M, A> ( K<SourceT<M>, A> ma, Func<(Seq<A> Items, A Item), bool> predicate)
- collectUntil <M, A> ( K<SourceT<M>, A> ma, Func<(Seq<A> Items, A Item), bool> predicate)
- collect <M, A> (K<SourceT<M>, A> ma)
Sub modules
| DSL |
| Extensions |
| Operators |
| Trait |
record SourceT <M, A> Source #
A source / stream of lifted values
Parameters
| type | A | Bound value type |
Methods
method K<M, S> Reduce <S> (S state, Reducer<A, S> reducer) Source #
Iterate the stream, flowing values downstream to the reducer, which aggregates a result value. This is returned lifted.
Note, this is recursive, so M needs to be able to support recursion without
blowing the stack. If you have the IO monad in your stack, then this will automatically
be the case.
Parameters
| type | S | State type |
| param | state | Initial state |
| param | reducer | Reducer |
| returns | Lifted aggregate state | |
method K<M, S> FoldReduce <S> (S state, Func<S, A, S> reducer) Source #
Iterate the stream, flowing values downstream to the reducer, which aggregates a result value. This is returned lifted.
Note, this is recursive, so M needs to be able to support recursion without
blowing the stack. If you have the IO monad in your stack, then this will automatically
be the case.
Parameters
| type | S | State type |
| param | state | Initial state |
| param | reducer | Reducer |
| returns | Lifted aggregate state | |
method K<M, S> ReduceM <S> (S state, ReducerM<M, A, S> reducer) Source #
Iterate the stream, flowing values downstream to the reducer, which aggregates a result value. This is returned lifted.
Note, this is recursive, so M needs to be able to support recursion without
blowing the stack. If you have the IO monad in your stack, then this will automatically
be the case.
Parameters
| type | S | State type |
| param | state | Initial state |
| param | reducer | Reducer |
| returns | Lifted aggregate state | |
method K<M, S> FoldReduceM <S> (S state, Func<S, A, K<M, S>> reducer) Source #
Iterate the stream, flowing values downstream to the reducer, which aggregates a result value. This is returned lifted.
Note, this is recursive, so M needs to be able to support recursion without
blowing the stack. If you have the IO monad in your stack, then this will automatically
be the case.
Parameters
| type | S | State type |
| param | state | Initial state |
| param | reducer | Reducer |
| returns | Lifted aggregate state | |
method SourceT<M, B> Transform <B> (TransducerM<M, 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 SourceT<M, A> Where (Func<A, bool> f) Source #
Filter values. Yielding downstream when true
Parameters
| param | f | Filter function |
| returns | SourceT where the only values yield are those that pass the predicate | |
method SourceT<M, A> Filter (Func<A, bool> f) Source #
Filter values. Yielding downstream when true
Parameters
| param | f | Filter function |
| returns | SourceT where the only values yield are those that pass the predicate | |
method SourceT<M, A> Combine (SourceT<M, A> rhs) Source #
Concatenate streams
Parameters
| param | this | Left-hand side |
| param | rhs | Right-hand side |
| returns | A stream that concatenates the input streams | |
method SourceT<M, A> Skip (int amount) Source #
Skip items in the source
Parameters
| param | amount | Amount to skip |
| returns | Transformed source | |
method SourceT<M, A> Take (int amount) Source #
Limit the number of items processed
Parameters
| param | amount | Amount to take |
| returns | Transformed source | |
method SourceT<M, 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 SourceT<M, 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 SourceT<M, S> FoldWhile <S> (Func<S, A, S> Fold, Func<(S State, A Value), 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 SourceT<M, S> FoldUntil <S> (Func<S, A, S> Fold, Func<(S State, A Value), 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 SourceT<M, S> FoldWhile <S> ( Schedule Time, Func<S, A, S> Fold, Func<(S State, A Value), 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 SourceT<M, S> FoldUntil <S> ( Schedule Time, Func<S, A, S> Fold, Func<(S State, A Value), 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 () Source #
Convert SourceT to a ProducerT pipe component
Parameters
| type | M | Monad to lift (must support |
| returns |
| |
method SourceT<M, C> SelectMany <B, C> (Func<A, SourceT<M, B>> bind, Func<A, B, C> project) Source #
Monad bind
method SourceT<M, C> SelectMany <B, C> (Func<A, K<M, B>> bind, Func<A, B, C> project) Source #
Monad bind
method SourceT<M, C> SelectMany <B, C> (Func<A, IO<B>> bind, Func<A, B, C> project) Source #
Monad bind
method SourceT<M, C> SelectMany <B, C> (Func<A, Pure<B>> bind, Func<A, B, C> project) Source #
Monad bind
method K<M, Reduced<S>> ReduceInternal <S> (S state, ReducerM<M, A, S> reducer) Source #
Iterate the stream, flowing values downstream to the reducer, which aggregates a result value. This is returned lifted.
Note, this is recursive, so M needs to be able to support recursion without
blowing the stack. If you have the IO monad in your stack, then this will automatically
be the case.
Parameters
| type | S | State type |
| param | state | Initial state |
| param | reducer | Reducer |
| returns | Lifted aggregate state | |
method K<M, Reduced<S>> ReduceInternalM <S> (S state, ReducerM<M, K<M, A>, S> reducer) Source #
Iterate the stream, flowing values downstream to the reducer, which aggregates a result value. This is returned lifted.
Note, this is recursive, so M needs to be able to support recursion without
blowing the stack. If you have the IO monad in your stack, then this will automatically
be the case.
Parameters
| type | S | State type |
| param | state | Initial state |
| param | reducer | Reducer |
| returns | Lifted aggregate state | |
Operators
operator >> (SourceT<M, A> lhs, K<SourceT<M>, Unit> rhs) Source #
Sequentially compose two actions. The second action is a unit returning action, so the result of the first action is propagated.
Parameters
| param | lhs | First action to run |
| param | rhs | Second action to run |
| returns | Result of the first action | |
Methods
method SourceT<M, A> empty <M, A> () Source #
Empty source
This is a 'void' source, it yields zero values.
Parameters
| type | A | Bound value type |
| returns | Uninhabited source | |
method SourceT<M, A> pure <M, 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 SourceT<M, Unit> done <M> () Source #
Indicate the stream is complete
Parameters
| type | M | |
| type | A | |
| param | value | |
| returns | ||
method SourceT<M, A> liftFoldable <F, M, A> (K<F, A> fa) Source #
Lift a foldable of pure values into a SourceT
Parameters
| type | F | Foldable trait type |
| type | M | Monad trait type |
| type | A | Bound value type |
| param | fa | Foldable of pure values |
| returns |
| |
method SourceT<M, A> liftFoldableM <F, M, A> (K<F, K<M, A>> fma) Source #
Lift a foldable of monadic values into a SourceT
Parameters
| type | F | Foldable trait type |
| type | M | Monad trait type |
| type | A | Bound value type |
| param | fma | Foldable of monadic values |
| returns |
| |
method SourceT<M, A> liftM <M, A> (K<M, A> ma) Source #
Lift a structure into the source
This is a singleton/unit source, it yields exactly one structure.
Parameters
| type | A | Bound value type |
| param | ma | Value to lift |
| returns | Singleton source | |
method SourceT<M, A> liftIO <M, A> (K<IO, A> ma) Source #
Lift a structure into the source
This is a singleton/unit source, it yields exactly one structure.
Parameters
| type | A | Bound value type |
| param | ma | Value to lift |
| returns | Singleton source | |
method SourceT<M, A> forever <M, 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 SourceT<M, A> foreverM <M, A> (K<M, A> ma) Source #
Lift a structure into the source and yield it for infinity
This is an infinite source, it repeatedly yields the provided structure.
Parameters
| type | A | Bound value type |
| param | ma | Value to lift |
| returns | Infinite source | |
method SourceT<M, A> lift <M, 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 |
| param | label | Label to help debugging |
| returns | Source of values | |
method SourceT<M, A> liftM <M, A> (Channel<K<M, 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 SourceT<M, A> lift <M, A> (Source<A> channel) Source #
Make a Source into a SourceT
Parameters
| type | A | Value type |
| param | channel | Channel to lift |
| returns | Source of values | |
method SourceT<M, A> liftM <M, A> (Source<K<M, A>> channel) Source #
Make a Source into a SourceT
Parameters
| type | A | Value type |
| param | channel | Channel to lift |
| returns | Source of values | |
method SourceT<M, A> lift <M, 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 SourceT<M, A> liftM <M, A> (IEnumerable<K<M, 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 SourceT<M, A> lift <M, A> (IObservable<A> items) Source #
Make an IObservable into a source of values
Parameters
| type | A | Value type |
| param | items |
|
| returns | Source of values | |
method SourceT<M, A> liftM <M, A> (IObservable<K<M, A>> items) Source #
Make an IObservable into a source of values
Parameters
| type | A | Value type |
| param | items |
|
| returns | Source of values | |
method SourceT<M, A> lift <M, A> (IAsyncEnumerable<A> items) Source #
Make an IAsyncEnumerable into a source of values
Parameters
| type | A | Value type |
| param | items |
|
| returns | Source of values | |
method SourceT<M, A> liftM <M, A> (IAsyncEnumerable<K<M, A>> items) Source #
Make an IAsyncEnumerable into a source of values
Parameters
| type | A | Value type |
| param | items |
|
| returns | Source of values | |
method SourceT<M, A> merge <M, A> (Seq<SourceT<M, 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 SourceT<M, A> merge <M, A> (params SourceT<M, 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 SourceT<M, (A First, B Second)> zip <M, A, B> (SourceT<M, A> first, SourceT<M, 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 SourceT<M, (A First, B Second, C Third)> zip <M, A, B, C> (SourceT<M, A> first, SourceT<M, B> second, SourceT<M, 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 SourceT<M, (A First, B Second, C Third, D Fourth)> zip <M, A, B, C, D> (SourceT<M, A> first, SourceT<M, B> second, SourceT<M, C> third, SourceT<M, 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 K<M, Unit> iter <M, A> (K<SourceT<M>, 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 happen.
method K<M, A> last <M, A> (K<SourceT<M>, A> ma) Source #
Force iteration of the stream, yielding the last structure processed
method K<M, Seq<A>> collectWhile <M, A> ( K<SourceT<M>, A> ma, Func<(Seq<A> Items, A Item), bool> predicate) Source #
Collect all the values into a Seq while the predicate holds.
Parameters
| type | M | |
| type | A | |
| param | ma | |
| returns | ||
method K<M, Seq<A>> collectUntil <M, A> ( K<SourceT<M>, A> ma, Func<(Seq<A> Items, A Item), bool> predicate) Source #
Collect all the values into a Seq while the predicate holds.
Parameters
| type | M | |
| type | A | |
| param | ma | |
| returns | ||