- Server <REQ, RES, M, A>
- Value
- Server (Proxy<Void, Unit, REQ, RES, M, A> value)
- ToProxy ()
- Bind <B> (Func<A, Proxy<Void, Unit, REQ, RES, M, B>> f)
- Map <B> (Func<A, B> f)
- MapM <B> (Func<K<M, A>, K<M, B>> f)
- ToIO ()
- Bind <B> (Func<A, Server<REQ, RES, M, B>> f)
- SelectMany <B> (Func<A, Server<REQ, RES, M, B>> f)
- SelectMany <B, C> (Func<A, Server<REQ, RES, M, B>> f, Func<A, B, C> project)
- Select <B> (Func<A, B> f)
- For <C1, C> (Func<RES, Proxy<Void, Unit, C1, C, M, REQ>> body)
- Action <S> (Proxy<Void, Unit, REQ, RES, M, S> r)
- PairEachRequestWithRespond <UOutA, AUInA> ( Func<Void, Proxy<UOutA, AUInA, Void, Unit, M, A>> lhs)
- ReplaceRequest <UOutA, AUInA> ( Func<Void, Proxy<UOutA, AUInA, REQ, RES, M, Unit>> lhs)
- PairEachRespondWithRequest <DInC, DOutC> ( Func<RES, Proxy<REQ, RES, DInC, DOutC, M, A>> rhs)
- ReplaceRespond <DInC, DOutC> ( Func<RES, Proxy<Void, Unit, DInC, DOutC, M, REQ>> rhs)
- Reflect ()
- Observe ()
- Deconstruct (out Proxy<Void, Unit, REQ, RES, M, A> value)
- & ( Server<REQ, RES, M, A> lhs, Server<REQ, RES, M, A> rhs)
- Server
record Server <REQ, RES, M, A> Source #
Server
receives requests of type REQ
and sends responses of type RES
.
Servers
only respond
and never request
.
Upstream | Downstream
+---------+
| |
Void〈== 〈== RES
| |
Unit ==〉 ==〉 REQ
| | |
+----|----+
|
A
method Proxy<Void, Unit, REQ, RES, M, A> ToProxy () Source #
Calling this will effectively cast the subtype 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<Void, Unit, REQ, RES, M, B> Bind <B> (Func<A, Proxy<Void, Unit, REQ, RES, 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 Proxy<Void, Unit, REQ, RES, 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<Void, Unit, REQ, RES, 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<Void, Unit, REQ, RES, M, IO<A>> ToIO () Source #
Extract the lifted IO monad (if there is one)
param | f | The map function |
returns | A new |
method Server<REQ, RES, M, B> Bind <B> (Func<A, Server<REQ, RES, M, B>> f) Source #
Monadic bind operation, for chaining Server
computations together.
type | B | The mapped bound value type |
param | f | The bind function |
returns | A new |
method Server<REQ, RES, M, B> SelectMany <B> (Func<A, Server<REQ, RES, M, B>> f) Source #
Monadic bind operation, for chaining Server
computations together.
type | B | The mapped bound value type |
param | f | The bind function |
returns | A new |
method Server<REQ, RES, M, C> SelectMany <B, C> (Func<A, Server<REQ, RES, M, B>> f, Func<A, B, C> project) Source #
Monadic bind operation, for chaining Server
computations together.
type | B | The mapped bound value type |
param | f | The bind function |
returns | A new |
method Server<REQ, RES, 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<Void, Unit, C1, C, M, A> For <C1, C> (Func<RES, Proxy<Void, Unit, C1, C, M, REQ>> body) Source #
For(body)
loops over the Proxy p
replacing each yield
with body
param | body | Any |
returns | A new |
method Proxy<Void, Unit, REQ, RES, M, S> Action <S> (Proxy<Void, Unit, REQ, RES, M, S> r) Source #
Applicative action
Invokes this Proxy
, then the Proxy r
param | r |
|
method Proxy<UOutA, AUInA, REQ, RES, M, A> PairEachRequestWithRespond <UOutA, AUInA> ( Func<Void, Proxy<UOutA, AUInA, Void, Unit, 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, REQ, RES, M, A> ReplaceRequest <UOutA, AUInA> ( Func<Void, Proxy<UOutA, AUInA, REQ, RES, M, Unit>> 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<Void, Unit, DInC, DOutC, M, A> PairEachRespondWithRequest <DInC, DOutC> ( Func<RES, Proxy<REQ, RES, 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<Void, Unit, DInC, DOutC, M, A> ReplaceRespond <DInC, DOutC> ( Func<RES, Proxy<Void, Unit, DInC, DOutC, M, REQ>> 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<RES, REQ, Unit, Void, M, A> Reflect () Source #
Reverse the arrows of the Proxy
to find its dual.
returns | The dual of |
method Proxy<Void, Unit, REQ, RES, 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<Void, Unit, REQ, RES, M, A> value) Source #
Server
receives requests of type REQ
and sends responses of type RES
.
Servers
only respond
and never request
.
Upstream | Downstream
+---------+
| |
Void〈== 〈== RES
| |
Unit ==〉 ==〉REQ
| | |
+----|----+
|
A
method Server<REQ, RES, M, R> Pure <REQ, RES, M, R> (R value) Source #
Monad return / pure
method Server<REQ, RES, M, REQ> respond <REQ, RES, M> (RES value) Source #
Send a value of type RES
downstream and block waiting for a reply of type REQ
respond
is the identity of the respond category.