- Pipe <IN, OUT, M, A>
- Value
- Pipe (Proxy<Unit, IN, Unit, OUT, M, A> value)
- ToProxy ()
- Bind <S> ( Func<A, Proxy<Unit, IN, Unit, OUT, M, S>> f)
- Bind <B> (Func<A, K<M, B>> f)
- Bind <B> (Func<A, IO<B>> f)
- Map <B> (Func<A, B> f)
- MapM <B> (Func<K<M, A>, K<M, B>> f)
- ToIO ()
- Bind <B> (Func<A, Pipe<IN, OUT, M, B>> f)
- Select <B> (Func<A, B> f)
- For <C1, C> ( Func<OUT, Proxy<Unit, IN, C1, C, M, Unit>> body)
- Action <S> (Proxy<Unit, IN, Unit, OUT, M, S> r)
- PairEachRequestWithRespond <UOutA, AUInA> ( Func<Unit, Proxy<UOutA, AUInA, Unit, IN, M, A>> lhs)
- ReplaceRequest <UOutA, AUInA> ( Func<Unit, Proxy<UOutA, AUInA, Unit, OUT, M, IN>> lhs)
- PairEachRespondWithRequest <DInC, DOutC> ( Func<OUT, Proxy<Unit, OUT, DInC, DOutC, M, A>> rhs)
- ReplaceRespond <DInC, DOutC> ( Func<OUT, Proxy<Unit, IN, DInC, DOutC, M, Unit>> rhs)
- Reflect ()
- Observe ()
- Deconstruct (out Proxy<Unit, IN, Unit, OUT, M, A> value)
- | (Producer<IN, M, A> p1, Pipe<IN, OUT, M, A> p2)
- | (Producer<IN, A> p1, Pipe<IN, OUT, M, A> p2)
- | (Producer<OUT, IN> p1, Pipe<IN, OUT, M, A> p2)
- | (Pipe<IN, OUT, M, A> p1, Consumer<OUT, A> p2)
- | (Pipe<IN, OUT, M, A> p1, Consumer<OUT, M, A> p2)
- Then <C> (Pipe<OUT, C, M, A> pipe)
- SelectMany <B> (Func<A, Pipe<IN, OUT, B>> bind)
- SelectMany <B, C> (Func<A, Pipe<IN, OUT, B>> bind, Func<A, B, C> project)
- SelectMany <B> (Func<A, Pipe<IN, OUT, M, B>> f)
- SelectMany <B, C> (Func<A, Pipe<IN, OUT, M, B>> f, 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)
- & ( Pipe<IN, OUT, M, A> lhs, Pipe<IN, OUT, M, A> rhs)
- ToString ()
- Pipe
- Pure <A, B, M, R> (R value)
- awaiting <M, A, Y> ()
- yield <IN, OUT, M> (OUT value)
- filter <M, A> (Func<A, bool> f)
- map <A, B, M, R> (Func<A, B> f)
- map <A, M, B> (Func<A, B> f)
- map <A, B> (Func<A, B> f)
- mapM <A, B, M, R> (Func<A, K<M, B>> f)
- lift <A, B, M, R> (K<M, R> ma)
- liftIO <A, B, M, R> (IO<R> ma)
- foldWhile <IN, OUT, M> ( OUT Initial, Func<OUT, IN, OUT> Fold, Func<OUT, bool> WhileState)
- foldUntil <IN, OUT, M> ( OUT Initial, Func<OUT, IN, OUT> Fold, Func<OUT, bool> UntilState)
- foldWhile <IN, OUT, M> ( OUT Initial , Func<OUT, IN, OUT> Fold, Func<IN, bool> WhileValue)
- foldUntil <IN, OUT, M> ( OUT Initial, Func<OUT, IN, OUT> Fold, Func<IN, bool> UntilValue)
- scan <IN, OUT, M, S> (Func<S, IN, S> Step, S Begin, Func<S, OUT> Done)
record Pipe <IN, OUT, M, A> Source #
Pipes both can both be await
and can yield
Upstream | Downstream
+---------+
| |
Unit <== <== Unit
| |
IN ==> ==> OUT
| | |
+----|----+
|
A
method Proxy<Unit, IN, Unit, OUT, M, A> ToProxy () Source #
Calling this will effectively cast the sub-type to the base.
This type wraps up a Proxy
for convenience, and so it's a Proxy
proxy. So calling this method
isn't exactly the same as a cast operation, as it unwraps the Proxy
from within. It has the same effect
however, and removes a level of indirection
returns | A general |
method Proxy<Unit, IN, Unit, OUT, M, S> Bind <S> ( Func<A, Proxy<Unit, IN, Unit, OUT, M, S>> f) Source #
Monadic bind operation, for chaining Proxy
computations together.
type | B | The mapped bound value type |
param | f | The bind function |
returns | A new |
method Pipe<IN, OUT, M, B> Bind <B> (Func<A, K<M, B>> f) Source #
Monadic bind operation, for chaining Proxy
computations together.
type | B | The mapped bound value type |
param | f | The bind function |
returns | A new |
method Pipe<IN, OUT, M, B> Bind <B> (Func<A, IO<B>> f) Source #
Monadic bind operation, for chaining Proxy
computations together.
type | B | The mapped bound value type |
param | f | The bind function |
returns | A new |
method Proxy<Unit, IN, Unit, OUT, M, B> Map <B> (Func<A, B> f) Source #
Lifts a pure function into the Proxy
domain, causing it to map the bound value within
type | B | The mapped bound value type |
param | f | The map function |
returns | A new |
method Proxy<Unit, IN, Unit, OUT, M, B> MapM <B> (Func<K<M, A>, K<M, B>> f) Source #
Map the lifted monad
type | B | The mapped bound value type |
param | f | The map function |
returns | A new |
method Proxy<Unit, IN, Unit, OUT, M, IO<A>> ToIO () Source #
Extract the lifted IO monad (if there is one)
param | f | The map function |
returns | A new |
method Pipe<IN, OUT, M, B> Bind <B> (Func<A, Pipe<IN, OUT, M, B>> f) Source #
Monadic bind operation, for chaining Proxy
computations together.
type | B | The mapped bound value type |
param | f | The bind function |
returns | A new |
method Pipe<IN, OUT, M, B> Select <B> (Func<A, B> f) Source #
Lifts a pure function into the Proxy
domain, causing it to map the bound value within
type | B | The mapped bound value type |
param | f | The map function |
returns | A new |
method Proxy<Unit, IN, C1, C, M, A> For <C1, C> ( Func<OUT, Proxy<Unit, IN, C1, C, M, Unit>> body) Source #
For(body)
loops over the Proxy p
replacing each yield
with body
param | body | Any |
returns | A new |
method Proxy<Unit, IN, Unit, OUT, M, S> Action <S> (Proxy<Unit, IN, Unit, OUT, M, S> r) Source #
Applicative action
Invokes this Proxy
, then the Proxy r
param | r |
|
method Proxy<UOutA, AUInA, Unit, OUT, M, A> PairEachRequestWithRespond <UOutA, AUInA> ( Func<Unit, Proxy<UOutA, AUInA, Unit, IN, M, A>> lhs) Source #
Used by the various composition functions and when composing proxies with the |
operator. You usually
wouldn't need to call this directly, instead either pipe them using |
or call Proxy.compose(lhs, rhs)
(f +>> p) pairs each 'request' in this
with a 'respond' in lhs
.
method Proxy<UOutA, AUInA, Unit, OUT, M, A> ReplaceRequest <UOutA, AUInA> ( Func<Unit, Proxy<UOutA, AUInA, Unit, OUT, M, IN>> lhs) Source #
Used by the various composition functions and when composing proxies with the |
operator. You usually
wouldn't need to call this directly, instead either pipe them using |
or call Proxy.compose(lhs, rhs)
method Proxy<Unit, IN, DInC, DOutC, M, A> PairEachRespondWithRequest <DInC, DOutC> ( Func<OUT, Proxy<Unit, OUT, DInC, DOutC, M, A>> rhs) Source #
Used by the various composition functions and when composing proxies with the |
operator. You usually
wouldn't need to call this directly, instead either pipe them using |
or call Proxy.compose(lhs, rhs)
method Proxy<Unit, IN, DInC, DOutC, M, A> ReplaceRespond <DInC, DOutC> ( Func<OUT, Proxy<Unit, IN, DInC, DOutC, M, Unit>> rhs) Source #
Used by the various composition functions and when composing proxies with the |
operator. You usually
wouldn't need to call this directly, instead either pipe them using |
or call Proxy.compose(lhs, rhs)
method Proxy<OUT, Unit, IN, Unit, M, A> Reflect () Source #
Reverse the arrows of the Proxy
to find its dual.
returns | The dual of |
method Proxy<Unit, IN, Unit, OUT, M, A> Observe () Source #
Observe(lift (Pure(r))) = Observe(Pure(r))
Observe(lift (m.Bind(f))) = Observe(lift(m.Bind(x => lift(f(x)))))
This correctness comes at a small cost to performance, so use this function sparingly. This function is a convenience for low-level pipes implementers. You do not need to use observe if you stick to the safe API.
method void Deconstruct (out Proxy<Unit, IN, Unit, OUT, M, A> value) Source #
method Pipe<IN, C, M, A> Then <C> (Pipe<OUT, C, M, A> pipe) Source #
Composition chaining of two pipes.
We can't provide the operator overloading to chain two pipes together, because operators don't have generics of their own. And so we can use this method to chain to pipes together.
type | C | Type of value that the right hand side pipe yields |
param | pipe | Right hand side |
returns | A composition of this pipe and the |
method Pipe<IN, OUT, M, B> SelectMany <B> (Func<A, Pipe<IN, OUT, B>> bind) Source #
Monadic bind operation, for chaining Proxy
computations together.
type | B | The mapped bound value type |
param | f | The bind function |
returns | A new |
method Pipe<IN, OUT, M, C> SelectMany <B, C> (Func<A, Pipe<IN, OUT, B>> bind, Func<A, B, C> project) Source #
Monadic bind operation, for chaining Proxy
computations together.
type | B | The mapped bound value type |
param | f | The bind function |
returns | A new |
method Pipe<IN, OUT, M, B> SelectMany <B> (Func<A, Pipe<IN, OUT, M, B>> f) Source #
Monadic bind operation, for chaining Proxy
computations together.
type | B | The mapped bound value type |
param | f | The bind function |
returns | A new |
method Pipe<IN, OUT, M, C> SelectMany <B, C> (Func<A, Pipe<IN, OUT, M, B>> f, Func<A, B, C> project) Source #
Monadic bind operation, for chaining Proxy
computations together.
type | B | The mapped bound value type |
param | f | The bind function |
returns | A new |
method Pipe<IN, OUT, M, C> SelectMany <B, C> (Func<A, K<M, B>> bind, Func<A, B, C> project) Source #
Monadic bind operation, for chaining Proxy
computations together.
type | B | The mapped bound value type |
param | f | The bind function |
returns | A new |
method Pipe<IN, OUT, M, C> SelectMany <B, C> (Func<A, IO<B>> bind, Func<A, B, C> project) Source #
Monadic bind operation, for chaining Proxy
computations together.
type | B | The mapped bound value type |
param | f | The bind function |
returns | A new |
operator | (Producer<IN, M, A> p1, Pipe<IN, OUT, M, A> p2) Source #
Compose a Producer
and a Pipe
together into a Producer
.
param | p1 |
|
param | p2 |
|
returns |
|
operator | (Producer<IN, A> p1, Pipe<IN, OUT, M, A> p2) Source #
Compose a Producer
and a Pipe
together into a Producer
.
param | p1 |
|
param | p2 |
|
returns |
|
operator | (Producer<OUT, IN> p1, Pipe<IN, OUT, M, A> p2) Source #
Compose a Producer
and a Pipe
together into a Producer
.
param | p1 |
|
param | p2 |
|
returns |
|
operator | (Pipe<IN, OUT, M, A> p1, Consumer<OUT, A> p2) Source #
Compose a Pipe
and a Consumer
together into a Consumer
.
param | p1 |
|
param | p2 |
|
returns |
|
Pipes both can both be await
and can yield
Upstream | Downstream
+---------+
| |
Unit <== <== Unit
| |
IN ==> ==> OUT
| | |
+----|----+
|
A
method Pipe<A, Y, M, A> awaiting <M, A, Y> () Source #
Wait for a value from upstream (whilst in a pipe)
This is the version of await
that works for pipes. In consumers, use Consumer.await
method Pipe<IN, OUT, M, Unit> yield <IN, OUT, M> (OUT value) Source #
Send a value downstream (whilst in a pipe)
This is the version of yield
that works for pipes. In producers, use Producer.yield
method Pipe<A, A, M, Unit> filter <M, A> (Func<A, bool> f) Source #
Only forwards values that satisfy the predicate.
method Pipe<A, B, M, R> map <A, B, M, R> (Func<A, B> f) Source #
Map the output of the pipe (not the bound value as is usual with Map)
method Pipe<A, B, M, Unit> map <A, M, B> (Func<A, B> f) Source #
Map the output of the pipe (not the bound value as is usual with Map)
method Pipe<A, B, Unit> map <A, B> (Func<A, B> f) Source #
Map the output of the pipe (not the bound value as is usual with Map)
method Pipe<A, B, M, R> mapM <A, B, M, R> (Func<A, K<M, B>> f) Source #
Apply a monadic function to all values flowing downstream (not the bound value as is usual with Map)
method Pipe<A, B, M, R> lift <A, B, M, R> (K<M, R> ma) Source #
Lift the IO monad into the Pipe monad transformer (a specialism of the Proxy monad transformer)
method Pipe<A, B, M, R> liftIO <A, B, M, R> (IO<R> ma) Source #
Lift the IO monad into the Pipe monad transformer (a specialism of the Proxy monad transformer)
method Pipe<IN, OUT, M, Unit> foldWhile <IN, OUT, M> ( OUT Initial, Func<OUT, IN, OUT> Fold, Func<OUT, bool> WhileState) Source #
Folds values coming down-stream, when the predicate returns false the folded value is yielded
param | Initial | Initial state |
param | Fold | Fold operation |
param | WhileState | Predicate |
returns | A pipe that folds |
method Pipe<IN, OUT, M, Unit> foldUntil <IN, OUT, M> ( OUT Initial, Func<OUT, IN, OUT> Fold, Func<OUT, bool> UntilState) Source #
Folds values coming down-stream, when the predicate returns true the folded value is yielded
param | Initial | Initial state |
param | Fold | Fold operation |
param | UntilState | Predicate |
returns | A pipe that folds |
method Pipe<IN, OUT, M, Unit> foldWhile <IN, OUT, M> ( OUT Initial , Func<OUT, IN, OUT> Fold, Func<IN, bool> WhileValue) Source #
Folds values coming down-stream, when the predicate returns false the folded value is yielded
param | Initial | Initial state |
param | Fold | Fold operation |
param | WhileValue | Predicate |
returns | A pipe that folds |
method Pipe<IN, OUT, M, Unit> foldUntil <IN, OUT, M> ( OUT Initial, Func<OUT, IN, OUT> Fold, Func<IN, bool> UntilValue) Source #
Folds values coming down-stream, when the predicate returns true the folded value is yielded
param | Initial | Initial state |
param | Fold | Fold operation |
param | UntilValue | Predicate |
returns | A pipe that folds |