LanguageExt.Core

LanguageExt.Core Type Classes MonadAsync

Contents

interface MonadAsync <MA, A> Source #

MonadAsync type-class

Parameters

type MA

The data-type to make monadic

type A

The data-type bound value

interface MonadAsync <Env, Out, MA, A> Source #

MonadAsync type-class

Parameters

type Env

The input type to the monadic computation

type Out

The output type of the monadic computation

type MA

The data-type to make monadic

type A

The data-type bound value

class TypeClass Source #

Methods

method MA ReturnAsync <MONAD, MA, A> (Task<A> x) Source #

where MONAD : struct, MonadAsync<MA, A>

Monad return

Parameters

type A

Type of the bound monad value

param x

The bound monad value

returns

Monad of A

method Task<MB> traverseAsync <MonadA, MonadB, MA, MB, A, B> (MA ma, Func<A, B> f) Source #

where MonadA : struct, MonadAsync<Unit, Unit, MA, A>
where MonadB : struct, MonadAsync<Unit, Unit, MB, B>

method Task<MB> traverseAsync <MonadA, MonadB, MA, MB, A, B> (MA ma, Func<A, Task<B>> f) Source #

where MonadA : struct, MonadAsync<Unit, Unit, MA, A>
where MonadB : struct, MonadAsync<Unit, Unit, MB, B>

method Task<MB> traverseAsync <MonadA, MonadB, MA, MB, A, B> (MA ma, Func<A, MB> f) Source #

where MonadA : struct, MonadAsync<Unit, Unit, MA, A>
where MonadB : struct, MonadAsync<Unit, Unit, MB, B>

method Task<MB> traverseAsync <MonadA, MonadB, MA, MB, A, B> (MA ma, Func<A, Task<MB>> f) Source #

where MonadA : struct, MonadAsync<Unit, Unit, MA, A>
where MonadB : struct, MonadAsync<Unit, Unit, MB, B>

method Func<Env, Task<MB>> traverseAsync <Env, Out, MonadA, MonadB, MA, MB, A, B> (MA ma, Func<A, B> f) Source #

where MonadA : struct, MonadAsync<Env, Out, MA, A>
where MonadB : struct, MonadAsync<Env, Out, MB, B>

method Func<Env, Task<MB>> traverseAsync <Env, Out, MonadA, MonadB, MA, MB, A, B> (MA ma, Func<A, Task<B>> f) Source #

where MonadA : struct, MonadAsync<Env, Out, MA, A>
where MonadB : struct, MonadAsync<Env, Out, MB, B>

method Func<Env, Task<MB>> traverseAsync <Env, Out, MonadA, MonadB, MA, MB, A, B> (MA ma, Func<A, MB> f) Source #

where MonadA : struct, MonadAsync<Env, Out, MA, A>
where MonadB : struct, MonadAsync<Env, Out, MB, B>

method Func<Env, Task<MB>> traverseAsync <Env, Out, MonadA, MonadB, MA, MB, A, B> (MA ma, Func<A, Task<MB>> f) Source #

where MonadA : struct, MonadAsync<Env, Out, MA, A>
where MonadB : struct, MonadAsync<Env, Out, MB, B>

method MB traverseSyncAsync <MonadA, MonadB, MA, MB, A, B> (MA ma, Func<A, MB> f) Source #

where MonadA : struct, Monad<Unit, Unit, MA, A>
where MonadB : struct, MonadAsync<Unit, Unit, MB, B>

method Func<Env, MB> traverseSyncAsync <Env, Out, MonadA, MonadB, MA, MB, A, B> (MA ma, Func<A, MB> f) Source #

where MonadA : struct, Monad<Env, Out, MA, A>
where MonadB : struct, MonadAsync<Env, Out, MB, B>

method Task<MB> traverseAsyncSync <MonadA, MonadB, MA, MB, A, B> (MA ma, Func<A, MB> f) Source #

where MonadA : struct, MonadAsync<Unit, Unit, MA, A>
where MonadB : struct, Monad<Unit, Unit, MB, B>

method Func<Env, Task<MB>> traverseAsyncSync <Env, Out, MonadA, MonadB, MA, MB, A, B> (MA ma, Func<A, MB> f) Source #

where MonadA : struct, MonadAsync<Env, Out, MA, A>
where MonadB : struct, Monad<Env, Out, MB, B>

method Task<MB> traverseAsyncSync <MonadA, MonadB, MA, MB, A, B> (MA ma, Func<A, Task<MB>> f) Source #

where MonadA : struct, MonadAsync<Unit, Unit, MA, A>
where MonadB : struct, Monad<Unit, Unit, MB, B>

method Func<Env, Task<MB>> traverseAsyncSync <Env, Out, MonadA, MonadB, MA, MB, A, B> (MA ma, Func<A, Task<MB>> f) Source #

where MonadA : struct, MonadAsync<Env, Out, MA, A>
where MonadB : struct, Monad<Env, Out, MB, B>

method MB bindAsync <MONADA, MONADB, MA, MB, A, B> (MA ma, Func<A, MB> f) Source #

where MONADA : struct, MonadAsync<MA, A>
where MONADB : struct, MonadAsync<MB, B>

Monadic bind

Parameters

type B

Type of the bound return value

param ma

Monad to bind

param f

Bind function

returns

Monad of B

method MB bindAsync <MONADA, MONADB, MA, MB, A, B> (MA ma, Func<A, Task<MB>> f) Source #

where MONADA : struct, MonadAsync<MA, A>
where MONADB : struct, MonadAsync<MB, B>

Monadic bind

Parameters

type B

Type of the bound return value

param ma

Monad to bind

param f

Bind function

returns

Monad of B

method MA failAsync <MONAD, MA, A> (Exception err = null) Source #

where MONAD : struct, MonadAsync<MA, A>

Produce a failure value

method MB liftMAsync <MONAD, FUNCTOR, MA, MB, A, B> (MA ma, Func<A, B> f) Source #

where FUNCTOR : struct, FunctorAsync<MA, MB, A, B>
where MONAD : struct, MonadAsync<MA, A>

Performs a map operation on the monad

Parameters

type B

The mapped type

param ma

Monad to map

param f

Mapping operation

returns

Mapped MonadAsync

method MB liftMAsync <MONAD, FUNCTOR, MA, MB, A, B> (MA ma, Func<A, Task<B>> f) Source #

where FUNCTOR : struct, FunctorAsync<MA, MB, A, B>
where MONAD : struct, MonadAsync<MA, A>

Performs a map operation on the monad

Parameters

type B

The mapped type

param ma

Monad to map

param f

Mapping operation

returns

Mapped MonadAsync

method MD joinAsync <EQ, MONADA, MONADB, MONADD, MA, MB, MD, A, B, C, D> ( MA self, MB inner, Func<A, C> outerKeyMap, Func<B, C> innerKeyMap, Func<A, B, D> project) Source #

where EQ : struct, Eq<C>
where MONADA : struct, MonadAsync<MA, A>
where MONADB : struct, MonadAsync<MB, B>
where MONADD : struct, MonadAsync<MD, D>

Monad join

method MD joinAsync <EQ, MONADA, MONADB, MONADD, MA, MB, MD, A, B, C, D> ( MA self, MB inner, Func<A, C> outerKeyMap, Func<B, C> innerKeyMap, Func<A, B, Task<D>> project) Source #

where EQ : struct, Eq<C>
where MONADA : struct, MonadAsync<MA, A>
where MONADB : struct, MonadAsync<MB, B>
where MONADD : struct, MonadAsync<MD, D>

Monad join

method MD joinAsync <EQ, MONADA, MONADB, MONADD, MA, MB, MD, A, B, C, D> ( MA self, MB inner, Func<A, Task<C>> outerKeyMap, Func<B, Task<C>> innerKeyMap, Func<A, B, Task<D>> project) Source #

where EQ : struct, Eq<C>
where MONADA : struct, MonadAsync<MA, A>
where MONADB : struct, MonadAsync<MB, B>
where MONADD : struct, MonadAsync<MD, D>

Monad join

method MD joinAsync <EQ, MONADA, MONADB, MONADD, MA, MB, MD, A, B, C, D> ( MA self, MB inner, Func<A, Task<C>> outerKeyMap, Func<B, Task<C>> innerKeyMap, Func<A, B, D> project) Source #

where EQ : struct, Eq<C>
where MONADA : struct, MonadAsync<MA, A>
where MONADB : struct, MonadAsync<MB, B>
where MONADD : struct, MonadAsync<MD, D>

Monad join

method MC SelectManyAsync <MONADA, MONADB, MONADC, MA, MB, MC, A, B, C> ( MA self, Func<A, MB> bind, Func<A, B, C> project) Source #

where MONADA : struct, MonadAsync<MA, A>
where MONADB : struct, MonadAsync<MB, B>
where MONADC : struct, MonadAsync<MC, C>

Monadic bind and project

method MC SelectManyAsync <MONADA, MONADB, MONADC, MA, MB, MC, A, B, C> ( MA self, Func<A, Task<MB>> bind, Func<A, B, C> project) Source #

where MONADA : struct, MonadAsync<MA, A>
where MONADB : struct, MonadAsync<MB, B>
where MONADC : struct, MonadAsync<MC, C>

Monadic bind and project

method MC SelectManyAsync <MONADA, MONADB, MONADC, MA, MB, MC, A, B, C> ( MA self, Func<A, Task<MB>> bind, Func<A, B, Task<C>> project) Source #

where MONADA : struct, MonadAsync<MA, A>
where MONADB : struct, MonadAsync<MB, B>
where MONADC : struct, MonadAsync<MC, C>

Monadic bind and project

method MC SelectManyAsync <MONADA, MONADB, MONADC, MA, MB, MC, A, B, C> ( MA self, Func<A, MB> bind, Func<A, B, Task<C>> project) Source #

where MONADA : struct, MonadAsync<MA, A>
where MONADB : struct, MonadAsync<MB, B>
where MONADC : struct, MonadAsync<MC, C>

Monadic bind and project

method MA mzeroAsync <MPLUS, MA, A> () Source #

where MPLUS : struct, MonadAsync<MA, A>

Return monad 'zero'. None for Option, [] for Lst, ...

Parameters

type MA

Monad type

type A

Bound type

returns

Zero for the structure

method MA mplusAsync <MPLUS, MA, A> (MA x, MA y) Source #

where MPLUS : struct, MonadAsync<MA, A>

Return monad x 'plus' monad y

Note, this doesn't add the bound values, it works on the monad state itself.

For example with Option:

None   'plus' None   = None
Some a 'plus' None   = Some a
None   'plus' Some b = Some b
Some a 'plus' Some b = Some a

Parameters

type MA

Monad type

type A

Bound type

param x

Left hand side of the operation

param y

Right hand side of the operation

returns

x 'plus' y

method MA msumAsync <MPLUS, MA, A> (params MA[] xs) Source #

where MPLUS : struct, MonadAsync<MA, A>

Performs the following fold operation: fold(xs, mzero, mplus)

Parameters

type MA

Monad type

type A

Bound type

param xs

The monads to sum

returns

The summed monads

method MA msumAsync <MPLUS, MA, A> (IEnumerable<MA> xs) Source #

where MPLUS : struct, MonadAsync<MA, A>

Performs the following fold operation: fold(xs, mzero, mplus)

Parameters

type MA

Monad type

type A

Bound type

param xs

The monads to sum

returns

The summed monads

method MA filterAsync <MPLUS, MA, A> (MA ma, Func<A, bool> pred) Source #

where MPLUS : struct, MonadAsync<MA, A>

Filters the monad if the predicate doesn't hold

Parameters

type MA

Monad type

type A

Bound type

param ma

The monads filter

returns

The filtered (or not) MonadAsync

method MA filterAsync <MPLUS, MA, A> (MA ma, Func<A, Task<bool>> pred) Source #

where MPLUS : struct, MonadAsync<MA, A>

Filters the monad if the predicate doesn't hold

Parameters

type MA

Monad type

type A

Bound type

param ma

The monads filter

returns

The filtered (or not) MonadAsync