LanguageExt.Core

LanguageExt.Core Monads Alternative Monads OptionT Extensions

Contents

class OptionTExtensions Source #

OptionT monad-transformer extensions

Methods

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

where M : Monad<M>

method K<M, Option<A>> Run <M, A> (this K<OptionT<M>, A> ma) Source #

where M : Monad<M>

method OptionT<M, B> Bind <M, A, B> (this K<OptionT<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

OptionT

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

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

method OptionT<IO, A> ToIO <A> (this Task<Option<A>> ma) Source #

Lift the task

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

where M : Monad<M>

Monadic join

method OptionT<M, C> SelectMany <M, A, B, C> ( this K<M, A> ma, Func<A, K<OptionT<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

OptionT

method OptionT<M, C> SelectMany <M, A, B, C> ( this K<M, A> ma, Func<A, OptionT<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

OptionT

method OptionT<M, C> SelectMany <M, A, B, C> ( this K<OptionT<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

OptionT

class OptionTExtensions Source #

Methods

method OptionT<M, B> Map <M, A, B> (this Func<A, B> f, K<OptionT<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 OptionT<M, B> Map <M, A, B> (this Func<A, B> f, OptionT<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 OptionT<M, B> Action <M, A, B> (this OptionT<M, A> ma, K<OptionT<M>, B> mb) Source #

where M : Monad<M>

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

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

where M : Monad<M>

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

method OptionT<M, B> Apply <M, A, B> (this OptionT<M, Func<A, B>> mf, K<OptionT<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 OptionT<M, B> Apply <M, A, B> (this K<OptionT<M>, Func<A, B>> mf, K<OptionT<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