LanguageExt.Core

LanguageExt.Core Monads Alternative Monads FinT Extensions

Contents

class FinTExtensions Source #

Methods

method FinT<M, B> Action <M, A, B> (this FinT<M, A> ma, FinT<M, B> mb) Source #

where M : Monad<M>

Applicative action: runs the first applicative, ignores the result, and returns the second applicative

method FinT<M, B> Apply <M, A, B> (this FinT<M, Func<A, B>> mf, K<FinT<M>, A> ma) Source #

where M : Monad<M>

Applicative functor apply operation

Unwraps the value within the ma applicative-functor, passes it to the unwrapped function(s) within mf, and then takes the resulting value and wraps it back up into a new applicative-functor.

Parameters

param ma

Value(s) applicative functor

param mf

Mapping function(s)

returns

Mapped applicative functor

method FinT<M, B> Apply <M, A, B> (this K<FinT<M>, Func<A, B>> mf, K<FinT<M>, A> ma) Source #

where M : Monad<M>

Applicative functor apply operation

Unwraps the value within the ma applicative-functor, passes it to the unwrapped function(s) within mf, and then takes the resulting value and wraps it back up into a new applicative-functor.

Parameters

param ma

Value(s) applicative functor

param mf

Mapping function(s)

returns

Mapped applicative functor

class FinTExtensions Source #

Methods

method FinT<M, A> As <M, A> (this K<FinT<M>, A> ma) Source #

where M : Monad<M>

method K<M, Fin<A>> Run <M, A> (this K<FinT<M>, A> ma) Source #

where M : Monad<M>

Runs the FinT exposing the outer monad with an inner wrapped Fin

method FinT<M, B> Bind <M, A, B> (this K<FinT<M>, A> ma, Func<A, IO<B>> f) Source #

where M : MonadIO<M>

Monad bind operation

Parameters

type B

Target bound value type

param f

Mapping function

returns

FinT

method FinT<IO, A> Flatten <A> (this Task<FinT<IO, A>> tma) Source #

Get the outer task and wrap it up in a new IO within the FinT IO

method FinT<IO, A> ToIO <M, A> (this Task<Fin<A>> ma) Source #

where M : Monad<M>

Lift the task

method FinT<M, A> Flatten <M, A> (this FinT<M, FinT<M, A>> mma) Source #

where M : Monad<M>

Monadic join

method FinT<M, C> SelectMany <M, A, B, C> ( this K<M, A> ma, Func<A, K<FinT<M>, B>> bind, Func<A, B, C> project) Source #

where M : Monad<M>

Monad bind operation

Parameters

type B

Intermediate bound value type

type C

Target bound value type

param bind

Monadic bind function

param project

Projection function

returns

FinT

method FinT<M, C> SelectMany <M, A, B, C> ( this K<M, A> ma, Func<A, FinT<M, B>> bind, Func<A, B, C> project) Source #

where M : Monad<M>

Monad bind operation

Parameters

type B

Intermediate bound value type

type C

Target bound value type

param bind

Monadic bind function

param project

Projection function

returns

FinT

method FinT<M, C> SelectMany <M, A, B, C> (this K<FinT<M>, A> ma, Func<A, IO<B>> bind, Func<A, B, C> project) Source #

where M : MonadIO<M>

Monad bind operation

Parameters

type B

Intermediate bound value type

type C

Target bound value type

param bind

Monadic bind function

param project

Projection function

returns

FinT

method K<M, (Seq<Error> Fails, Seq<A> Succs)> Partition <F, M, A> (this K<F, FinT<M, A>> self) Source #

where F : Foldable<F>
where M : Monad<M>

Partitions a foldable of FinT into two sequences.

All the Fail elements are extracted, in order, to the first component of the output. Similarly, the Succ elements are extracted to the second component of the output.

Parameters

returns

A pair containing the sequences of partitioned values

method K<M, Seq<Error>> Fails <F, M, A> (this K<F, FinT<M, A>> self) Source #

where F : Foldable<F>
where M : Monad<M>

Partitions a foldable of FinT into two lists and returns the Fail items only.

Parameters

returns

A sequence of partitioned items

method K<M, Seq<A>> Succs <F, M, A> (this K<F, FinT<M, A>> self) Source #

where F : Foldable<F>
where M : Monad<M>

Partitions a foldable of FinT into two lists and returns the Succ items only.

Parameters

returns

A sequence of partitioned items

class FinTExtensions Source #

Methods

method FinT<M, B> Map <M, A, B> (this Func<A, B> f, K<FinT<M>, A> ma) Source #

where M : Monad<M>

Functor map operation

Unwraps the value within the functor, passes it to the map function f provided, and then takes the mapped value and wraps it back up into a new functor.

Parameters

param ma

Functor to map

param f

Mapping function

returns

Mapped functor

method FinT<M, B> Map <M, A, B> (this Func<A, B> f, FinT<M, A> ma) Source #

where M : Monad<M>

Functor map operation

Unwraps the value within the functor, passes it to the map function f provided, and then takes the mapped value and wraps it back up into a new functor.

Parameters

param ma

Functor to map

param f

Mapping function

returns

Mapped functor

class FinTGuardExtensions Source #

Methods

method FinT<M, Unit> ToFinT <M> (this Guard<Error, Unit> guard) Source #

where M : Monad<M>

Natural transformation to FinT

method FinT<M, B> Bind <M, B> ( this Guard<Error, Unit> guard, Func<Unit, FinT<M, B>> f) Source #

where M : Monad<M>

Monadic binding support for FinT

method FinT<M, C> SelectMany <M, B, C> ( this Guard<Error, Unit> guard, Func<Unit, FinT<M, B>> bind, Func<Unit, B, C> project) Source #

where M : Monad<M>

Monadic binding support for FinT

method FinT<M, Unit> SelectMany <M, A> ( this FinT<M, A> ma, Func<A, Guard<Error, Unit>> f) Source #

where M : Monad<M>

Monadic binding support for FinT

method FinT<M, C> SelectMany <M, A, C> ( this FinT<M, A> ma, Func<A, Guard<Error, Unit>> bind, Func<A, Unit, C> project) Source #

where M : Monad<M>

Monadic binding support for FinT