LanguageExt.Core

LanguageExt.Core Monads Alternative Monads ValidationT Extensions

Contents

class ValidationTExtensions Source #

Methods

method ValidationT<F, M, B> Action <F, M, A, B> (this ValidationT<F, M, A> ma, K<ValidationT<F, M>, B> mb) Source #

where F : Monoid<F>
where M : Monad<M>

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

method ValidationT<F, M, B> Action <F, M, A, B> (this K<ValidationT<F, M>, A> ma, K<ValidationT<F, M>, B> mb) Source #

where F : Monoid<F>
where M : Monad<M>

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

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

where F : Monoid<F>
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 ValidationT<F, M, B> Apply <F, M, A, B> (this K<ValidationT<F, M>, Func<A, B>> mf, K<ValidationT<F, M>, A> ma) Source #

where F : Monoid<F>
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 ValidationTExtensions Source #

ValidationT monad transformer extensions

Methods

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

where M : Monad<M>

method ValidationT<F, M, A> As2 <F, M, A> (this K<ValidationT<M>, F, A> ma) Source #

where M : Monad<M>

method K<M, Validation<F, A>> Run <F, M, A> (this K<ValidationT<F, M>, A> ma) Source #

where M : Monad<M>
where F : Monoid<F>

method K<M, B> Match <F, M, A, B> ( this K<ValidationT<F, M>, A> ma, Func<F, B> Fail, Func<A, B> Succ) Source #

where M : Monad<M>
where F : Monoid<F>

method ValidationT<F1, M, A> MapFail <F, F1, M, A> ( this K<ValidationT<F, M>, A> ma, Func<F, F1> f) Source #

where M : Monad<M>
where F : Monoid<F>
where F1 : Monoid<F1>

Maps the bound value

Parameters

type B

Target bound value type

param f

Mapping function

returns

ValidationT

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

where M : Monad<M>
where F : Monoid<F>

Monadic join

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

where F : Monoid<F>

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

method ValidationT<L, IO, A> ToIO <L, A> (this Task<Validation<L, A>> ma) Source #

where L : Monoid<L>

Lift the task

method OptionT<M, A> ToOption <F, M, A> (this ValidationT<F, M, A> ma) Source #

where F : Monoid<F>
where M : Monad<M>

method EitherT<F, M, A> ToEither <F, M, A> (this ValidationT<F, M, A> ma) Source #

where F : Monoid<F>
where M : Monad<M>

method FinT<M, A> ToFin <M, A> (this ValidationT<Error, M, A> ma) Source #

where M : Monad<M>

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

where M : Monad<M>
where L : Monoid<L>

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

ValidationT

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

where M : Monad<M>
where L : Monoid<L>

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

ValidationT

class ValidationTExtensions Source #

Methods

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

where F : Monoid<F>
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 ValidationT<F, M, B> Map <F, M, A, B> (this Func<A, B> f, ValidationT<F, M, A> ma) Source #

where F : Monoid<F>
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 ValidationTGuardExtensions Source #

Methods

method ValidationT<F, M, Unit> ToValidationT <F, M> (this Guard<F, Unit> guard) Source #

where M : Monad<M>
where F : Monoid<F>

Natural transformation to ValidationT

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

where M : Monad<M>
where F : Monoid<F>

Monadic binding support for ValidationT

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

where M : Monad<M>
where F : Monoid<F>

Monadic binding support for Validation