LanguageExt.Core

LanguageExt.Core Effects Pipes Server

Contents

class Server <RT, REQ, RES, A> Source #

where RT : struct, HasCancel<RT>

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

Fields

field Proxy<RT, Void, Unit, REQ, RES, A> Value Source #

Constructors

constructor Server (Proxy<RT, Void, Unit, REQ, RES, A> value) Source #

Constructor

Parameters

param value

Correctly shaped Proxy that represents a Server

Methods

method Proxy<RT, Void, Unit, REQ, RES, 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

Parameters

returns

A general Proxy type from a more specialised type

method Proxy<RT, Void, Unit, REQ, RES, S> Bind <S> (Func<A, Proxy<RT, Void, Unit, REQ, RES, S>> f) Source #

Monadic bind operation, for chaining Proxy computations together.

Parameters

type B

The mapped bound value type

param f

The bind function

returns

A new Proxy that represents the composition of this Proxy and the result of the bind operation

method Proxy<RT, Void, Unit, REQ, RES, S> Map <S> (Func<A, S> f) Source #

Lifts a pure function into the Proxy domain, causing it to map the bound value within

Parameters

type B

The mapped bound value type

param f

The map function

returns

A new Proxy that represents the composition of this Proxy and the result of the map operation

method Server<RT, REQ, RES, B> Bind <B> (Func<A, Server<RT, REQ, RES, B>> f) Source #

Monadic bind operation, for chaining Server computations together.

Parameters

type B

The mapped bound value type

param f

The bind function

returns

A new Proxy that represents the composition of this Proxy and the result of the bind operation

method Server<RT, REQ, RES, B> SelectMany <B> (Func<A, Server<RT, REQ, RES, B>> f) Source #

Monadic bind operation, for chaining Server computations together.

Parameters

type B

The mapped bound value type

param f

The bind function

returns

A new Proxy that represents the composition of this Proxy and the result of the bind operation

method Server<RT, REQ, RES, C> SelectMany <B, C> (Func<A, Server<RT, REQ, RES, B>> f, Func<A, B, C> project) Source #

Monadic bind operation, for chaining Server computations together.

Parameters

type B

The mapped bound value type

param f

The bind function

returns

A new Proxy that represents the composition of this Proxy and the result of the bind operation

method Server<RT, REQ, RES, B> Select <B> (Func<A, B> f) Source #

Lifts a pure function into the Proxy domain, causing it to map the bound value within

Parameters

type B

The mapped bound value type

param f

The map function

returns

A new Proxy that represents the composition of this Proxy and the result of the map operation

method Proxy<RT, Void, Unit, C1, C, A> For <C1, C> (Func<RES, Proxy<RT, Void, Unit, C1, C, REQ>> body) Source #

For(body) loops over the Proxy p replacing each yield with body

Parameters

param body

Any yield found in the Proxy will be replaced with this function. It will be composed so that the value yielded will be passed to the argument of the function. That returns a Proxy to continue the processing of the computation

returns

A new Proxy that represents the composition of this Proxy and the function provided

method Proxy<RT, Void, Unit, REQ, RES, S> Action <S> (Proxy<RT, Void, Unit, REQ, RES, S> r) Source #

Applicative action

Invokes this Proxy, then the Proxy r

Parameters

param r

Proxy to run after this one

method Proxy<RT, UOutA, AUInA, REQ, RES, A> PairEachRequestWithRespond <UOutA, AUInA> (Func<Void, Proxy<RT, UOutA, AUInA, Void, Unit, 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<RT, UOutA, AUInA, REQ, RES, A> ReplaceRequest <UOutA, AUInA> (Func<Void, Proxy<RT, UOutA, AUInA, REQ, RES, 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<RT, Void, Unit, DInC, DOutC, A> PairEachRespondWithRequest <DInC, DOutC> (Func<RES, Proxy<RT, REQ, RES, DInC, DOutC, 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<RT, Void, Unit, DInC, DOutC, A> ReplaceRespond <DInC, DOutC> (Func<RES, Proxy<RT, Void, Unit, DInC, DOutC, 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<RT, RES, REQ, Unit, Void, A> Reflect () Source #

Reverse the arrows of the Proxy to find its dual.

Parameters

returns

The dual of this

method Proxy<RT, Void, Unit, REQ, RES, 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<RT, Void, Unit, REQ, RES, A> value) Source #

method Server<RT, REQ, RES, B> SelectMany <B> (Func<A, Release<B>> bind) Source #

Monadic bind operation, for chaining Server computations together.

Parameters

type B

The mapped bound value type

param f

The bind function

returns

A new Proxy that represents the composition of this Proxy and the result of the bind operation

method Server<RT, REQ, RES, C> SelectMany <B, C> (Func<A, Release<B>> bind, Func<A, B, C> project) Source #

Monadic bind operation, for chaining Server computations together.

Parameters

type B

The mapped bound value type

param f

The bind function

returns

A new Proxy that represents the composition of this Proxy and the result of the bind operation

Operators

operator & ( Server<RT, REQ, RES, A> lhs, Server<RT, REQ, RES, A> rhs) Source #

Chain one server after another

class Server 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

Methods

method Server<RT, REQ, RES, R> Pure <RT, REQ, RES, R> (R value) Source #

where RT : struct, HasCancel<RT>

Monad return / pure

method Server<RT, REQ, RES, REQ> respond <RT, REQ, RES> (RES value) Source #

where RT : struct, HasCancel<RT>

Send a value of type RES downstream and block waiting for a reply of type REQ

respond is the identity of the respond category.

method Server<RT, REQ, RES, R> lift <RT, REQ, RES, R> (Aff<R> ma) Source #

where RT : struct, HasCancel<RT>

Lift am IO monad into the Proxy monad transformer

method Server<RT, REQ, RES, R> lift <RT, REQ, RES, R> (Eff<R> ma) Source #

where RT : struct, HasCancel<RT>

Lift am IO monad into the Proxy monad transformer

method Server<RT, REQ, RES, R> lift <RT, REQ, RES, R> (Aff<RT, R> ma) Source #

where RT : struct, HasCancel<RT>

Lift am IO monad into the Proxy monad transformer

method Server<RT, REQ, RES, R> lift <RT, REQ, RES, R> (Eff<RT, R> ma) Source #

where RT : struct, HasCancel<RT>

Lift am IO monad into the Proxy monad transformer

method Server<RT, REQ, RES, R> use <RT, REQ, RES, R> (Aff<R> ma) Source #

where RT : struct, HasCancel<RT>
where R : IDisposable

Lift am IO monad into the Proxy monad transformer

method Server<RT, REQ, RES, R> use <RT, REQ, RES, R> (Eff<R> ma) Source #

where RT : struct, HasCancel<RT>
where R : IDisposable

Lift am IO monad into the Proxy monad transformer

method Server<RT, REQ, RES, R> use <RT, REQ, RES, R> (Aff<RT, R> ma) Source #

where RT : struct, HasCancel<RT>
where R : IDisposable

Lift am IO monad into the Proxy monad transformer

method Server<RT, REQ, RES, R> use <RT, REQ, RES, R> (Eff<RT, R> ma) Source #

where RT : struct, HasCancel<RT>
where R : IDisposable

Lift am IO monad into the Proxy monad transformer

method Server<RT, REQ, RES, R> use <RT, REQ, RES, R> (Aff<R> ma, Func<R, Unit> dispose) Source #

where RT : struct, HasCancel<RT>

Lift am IO monad into the Proxy monad transformer

method Server<RT, REQ, RES, R> use <RT, REQ, RES, R> (Eff<R> ma, Func<R, Unit> dispose) Source #

where RT : struct, HasCancel<RT>

Lift am IO monad into the Proxy monad transformer

method Server<RT, REQ, RES, R> use <RT, REQ, RES, R> (Aff<RT, R> ma, Func<R, Unit> dispose) Source #

where RT : struct, HasCancel<RT>

Lift am IO monad into the Proxy monad transformer

method Server<RT, REQ, RES, R> use <RT, REQ, RES, R> (Eff<RT, R> ma, Func<R, Unit> dispose) Source #

where RT : struct, HasCancel<RT>

Lift am IO monad into the Proxy monad transformer

method Server<RT, REQ, RES, Unit> release <RT, REQ, RES, R> (R dispose) Source #

where RT : struct, HasCancel<RT>

Release a previously used resource