Contents
- TransduceFrom <IN>
- Transducer <A, B>
- Reduce <S> (ReducerAsync<B, S> reducer)
- Compose <C> (Transducer<B, C> tg)
- Map <C> (Func<B, C> f)
- Comap <X> (Func<X, A> f)
- Bind <C> (Func<B, K<TransduceFrom<A>, C>> f)
- Bind <C> (Func<B, Transducer<A, C>> f)
- SelectMany <C, D> (Func<B, K<TransduceFrom<A>, C>> bind, Func<B, C, D> project)
- SelectMany <C, D> (Func<B, Transducer<A, C>> bind, Func<B, C, D> project)
- Filter (Func<B, bool> f)
- Where (Func<B, bool> f)
- Take (int n)
- Skip (int n)
- FoldWhile <S> ( Func<S, B, S> Folder, Func<S, B, bool> Pred, S State)
- FoldWhile <S> ( Schedule Schedule, Func<S, B, S> Folder, Func<S, B, bool> Pred, S State)
- FoldUntil <S> ( Func<S, B, S> Folder, Func<S, B, bool> Pred, S State)
- FoldUntil <S> ( Schedule Schedule, Func<S, B, S> Folder, Func<S, B, bool> Pred, S State)
- TransducerExtensions
- Transducer
- identity <A> ()
- constant <A, B> (B value)
- compose <A, B, C> ( Transducer<A, B> ta, Transducer<B, C> tb)
- compose <A, B, C, D> ( Transducer<A, B> ta, Transducer<B, C> tb, Transducer<C, D> tc)
- compose <A, B, C, D, E> ( Transducer<A, B> ta, Transducer<B, C> tb, Transducer<C, D> tc, Transducer<D, E> td)
- compose <A, B, C, D, E, F> ( Transducer<A, B> ta, Transducer<B, C> tb, Transducer<C, D> tc, Transducer<D, E> td, Transducer<E, F> te)
- compose <A, B, C, D, E, F, G> ( Transducer<A, B> ta, Transducer<B, C> tb, Transducer<C, D> tc, Transducer<D, E> td, Transducer<E, F> te, Transducer<F, G> tf)
- skip <A> (int amount)
- take <A> (int amount)
- map <A, B> (Func<A, B> f)
- filter <A> (Func<A, bool> predicate)
- bind <Env, A, B> (Transducer<Env, A> ta, Func<A, K<TransduceFrom<Env>, B>> f)
- bind <Env, A, B> (Transducer<Env, A> ta, Func<A, Transducer<Env, B>> f)
- foldWhile <A, S> ( Func<S, A, S> Folder, Func<S, A, bool> Pred, S State)
- foldWhile <A, S> ( Schedule Schedule, Func<S, A, S> Folder, Func<S, A, bool> Pred, S State)
- foldUntil <A, S> ( Func<S, A, S> Folder, Func<S, A, bool> Pred, S State)
- foldUntil <A, S> ( Schedule Schedule, Func<S, A, S> Folder, Func<S, A, bool> Pred, S State)
- TransduceTo <OUT>
Sub modules
DSL |
class TransduceFrom <IN> Source #
record Transducer <A, B> Source #
Methods
method ReducerAsync<A, S> Reduce <S> (ReducerAsync<B, S> reducer) Source #
Fold the input stream using the supplied reducer.
Parameters
type | S | State |
param | reducer | Reducer that folds the stream of values flowing through the transducer |
returns |
method Transducer<A, C> Compose <C> (Transducer<B, C> tg) Source #
Compose two transducers together. The output of the first transducer is the input to the second.
method Transducer<A, D> SelectMany <C, D> (Func<B, K<TransduceFrom<A>, C>> bind, Func<B, C, D> project) Source #
Monadic bind
method Transducer<A, D> SelectMany <C, D> (Func<B, Transducer<A, C>> bind, Func<B, C, D> project) Source #
Monadic bind
method Transducer<A, B> Filter (Func<B, bool> f) Source #
Filter values flowing through the transducer.
method Transducer<A, B> Where (Func<B, bool> f) Source #
Filter values flowing through the transducer.
method Transducer<A, S> FoldWhile <S> ( Func<S, B, S> Folder, Func<S, B, bool> Pred, S State) Source #
method Transducer<A, S> FoldWhile <S> ( Schedule Schedule, Func<S, B, S> Folder, Func<S, B, bool> Pred, S State) Source #
class TransducerExtensions Source #
class Transducer Source #
Methods
method Transducer<A, A> identity <A> () Source #
Identity transducer. Has no effect on values flowing through.
Parameters
type | A | Bound value type |
returns | Identity transducer |
method Transducer<A, B> constant <A, B> (B value) Source #
Constant transducer. Ignores all incoming values and yields the constant value.
Parameters
type | B | Constant value type |
returns | Constant transducer |
method Transducer<A, C> compose <A, B, C> ( Transducer<A, B> ta, Transducer<B, C> tb) Source #
Compose transducers together. The output of each transducer is fed into the next transducer.
Parameters
param | ta | First transducer |
param | tb | Second transducer |
returns | Composed transducer |
method Transducer<A, D> compose <A, B, C, D> ( Transducer<A, B> ta, Transducer<B, C> tb, Transducer<C, D> tc) Source #
Compose transducers together. The output of each transducer is fed into the next transducer.
Parameters
param | ta | First transducer |
param | tb | Second transducer |
param | tc | Third transducer |
returns | Composed transducer |
method Transducer<A, E> compose <A, B, C, D, E> ( Transducer<A, B> ta, Transducer<B, C> tb, Transducer<C, D> tc, Transducer<D, E> td) Source #
Compose transducers together. The output of each transducer is fed into the next transducer.
Parameters
param | ta | First transducer |
param | tb | Second transducer |
param | tc | Third transducer |
param | td | Fourth transducer |
returns | Composed transducer |
method Transducer<A, F> compose <A, B, C, D, E, F> ( Transducer<A, B> ta, Transducer<B, C> tb, Transducer<C, D> tc, Transducer<D, E> td, Transducer<E, F> te) Source #
Compose transducers together. The output of each transducer is fed into the next transducer.
Parameters
param | ta | First transducer |
param | tb | Second transducer |
param | tc | Third transducer |
param | td | Fourth transducer |
param | te | Fifth transducer |
returns | Composed transducer |
method Transducer<A, G> compose <A, B, C, D, E, F, G> ( Transducer<A, B> ta, Transducer<B, C> tb, Transducer<C, D> tc, Transducer<D, E> td, Transducer<E, F> te, Transducer<F, G> tf) Source #
Compose transducers together. The output of each transducer is fed into the next transducer.
Parameters
param | ta | First transducer |
param | tb | Second transducer |
param | tc | Third transducer |
param | td | Fourth transducer |
param | te | Fifth transducer |
param | tf | Sixth transducer |
returns | Composed transducer |
method Transducer<A, A> skip <A> (int amount) Source #
Skip amount
items in the sequence before yielding
Parameters
type | A | Value type |
param | amount | Number of items to skip |
returns | Transducer that skips values |
method Transducer<A, A> take <A> (int amount) Source #
Take amount
items in the sequence before terminating
Parameters
type | A | Value type |
param | amount | Number of items to take |
returns | Transducer that takes |
method Transducer<A, B> map <A, B> (Func<A, B> f) Source #
Functor map transducer
Parameters
type | A | Input value type |
type | B | Output value type |
param | f | Function to map values of type |
returns | Mapping transducer |
method Transducer<A, A> filter <A> (Func<A, bool> predicate) Source #
Applicative filter transducer
Parameters
type | A | Bound value type |
param | predicate | Filters each value flowing through the transducer. If |
returns | Filtering transducer |
method Transducer<Env, B> bind <Env, A, B> (Transducer<Env, A> ta, Func<A, K<TransduceFrom<Env>, B>> f) Source #
Monad bind transducer
Chains two transducers together
Parameters
type | Env | Input value type |
type | A | Result value type of the first transducer |
type | B | Result value type of returned transducer |
param | ta | Initial transducer to run |
param | f | Chaining function to run with the result of |
returns | A monadic bind transducer operation |
method Transducer<Env, B> bind <Env, A, B> (Transducer<Env, A> ta, Func<A, Transducer<Env, B>> f) Source #
Monad bind transducer
Chains two transducers together
Parameters
type | Env | Input value type |
type | A | Result value type of the first transducer |
type | B | Result value type of returned transducer |
param | ta | Initial transducer to run |
param | f | Chaining function to run with the result of |
returns | A monadic bind transducer operation |
method Transducer<A, S> foldWhile <A, S> ( Func<S, A, S> Folder, Func<S, A, bool> Pred, S State) Source #
Fold items in the stream while the predicate returns true; once the predicate returns false, the aggregated value is yielded downstream.
Parameters
type | A | Bound value type |
type | S | Yielded aggregate value type |
param | Folder | Aggregating binary fold function |
param | Pred | Predicate |
param | State | Initial state |
returns | Aggregating binary folding transducer |
method Transducer<A, S> foldWhile <A, S> ( Schedule Schedule, Func<S, A, S> Folder, Func<S, A, bool> Pred, S State) Source #
Fold items in the stream while the predicate returns true; once the predicate returns false, the aggregated value is yielded downstream.
Parameters
type | A | Bound value type |
type | S | Yielded aggregate value type |
param | Schedule | Schedule for each yielded item |
param | Folder | Aggregating binary fold function |
param | Pred | Predicate |
param | State | Initial state |
returns | Aggregating binary folding transducer |
method Transducer<A, S> foldUntil <A, S> ( Func<S, A, S> Folder, Func<S, A, bool> Pred, S State) Source #
Fold items in the stream until the predicate returns true; once the predicate returns true, the aggregated value is yielded downstream.
Parameters
type | A | Bound value type |
type | S | Yielded aggregate value type |
param | Folder | Aggregating binary fold function |
param | Pred | Predicate |
param | State | Initial state |
returns | Aggregating binary folding transducer |
method Transducer<A, S> foldUntil <A, S> ( Schedule Schedule, Func<S, A, S> Folder, Func<S, A, bool> Pred, S State) Source #
Fold items in the stream until the predicate returns true; once the predicate returns true, the aggregated value is yielded downstream.
Parameters
type | A | Bound value type |
type | S | Yielded aggregate value type |
param | Schedule | Schedule for each yielded item |
param | Folder | Aggregating binary fold function |
param | Pred | Predicate |
param | State | Initial state |
returns | Aggregating binary folding transducer |
class TransduceTo <OUT> Source #