LanguageExt.Core

LanguageExt.Core Monads State and Environment Monads Reader ReaderT Extensions

Contents

class ReaderTExtensions Source #

Reader monad extensions

Methods

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

where M : Monad<M>

method K<M, A> Run <Env, M, A> (this K<ReaderT<Env, M>, A> ma, Env env) Source #

where M : Monad<M>

Run the reader monad

Parameters

param env

Input environment

returns

Bound monad

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

where M : Monad<M>

Monadic join

method ReaderT<Env, M, A> Flatten <Env, M, A> (this ReaderT<Env, M, K<ReaderT<Env, M>, A>> mma) Source #

where M : Monad<M>

Monadic join

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

ReaderT

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

ReaderT

class ReaderTExtensions Source #

Methods

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

where M : Monad<M>, Alternative<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 ReaderT<Env, M, B> Map <Env, M, A, B> (this Func<A, B> f, ReaderT<Env, M, A> ma) Source #

where M : Monad<M>, Alternative<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 ReaderT<Env, M, B> Action <Env, M, A, B> (this ReaderT<Env, M, A> ma, K<ReaderT<Env, M>, B> mb) Source #

where M : Monad<M>, Alternative<M>

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

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

where M : Monad<M>, Alternative<M>

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

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

where M : Monad<M>, Alternative<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 ReaderT<Env, M, B> Apply <Env, M, A, B> (this K<ReaderT<Env, M>, Func<A, B>> mf, K<ReaderT<Env, M>, A> ma) Source #

where M : Monad<M>, Alternative<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