LanguageExt.Core

LanguageExt.Core Monads Free

Contents

record Free <F, A> Source #

where F : Functor<F>

Free monad makes any functor into a monad

Parameters

type F

Functor type

type A

Bound value type

Methods

method Free<F, B> Map <B> (Func<A, B> f) Source #

method Free<F, B> Select <B> (Func<A, B> f) Source #

method Free<F, B> Bind <B> (Func<A, Free<F, B>> f) Source #

method Free<F, B> Bind <B> (Func<A, K<Free<F>, B>> f) Source #

method Free<F, C> SelectMany <B, C> (Func<A, K<Free<F>, B>> bind, Func<A, B, C> project) Source #

record Pure <F, A> (A Value) Source #

where F : Functor<F>

Terminal case for the free monad

Parameters

type F

Functor type

type A

Bound value type

param Value

Terminal value

record Bind <F, A> (K<F, Free<F, A>> Value) Source #

where F : Functor<F>

Monadic bind case for the free monad

Parameters

type F

Functor type

type A

Bound value type

param Value

Functor that yields a Free monad

class FreeExtensions Source #

Methods

method Free<Fnctr, A> As <Fnctr, A> (this K<Free<Fnctr>, A> ma) Source #

where Fnctr : Functor<Fnctr>

class FreeExtensions Source #

Methods

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

where F : Functor<F>

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 Free<F, B> Map <F, A, B> (this Func<A, B> f, Free<F, A> ma) Source #

where F : Functor<F>

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 Free<F, B> Action <F, A, B> (this Free<F, A> ma, K<Free<F>, B> mb) Source #

where F : Functor<F>

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

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

where F : Functor<F>

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

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

where F : Functor<F>

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 Free<F, B> Apply <F, A, B> (this K<Free<F>, Func<A, B>> mf, K<Free<F>, A> ma) Source #

where F : Functor<F>

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 Free Source #

Methods

method Free<F, A> pure <F, A> (A value) Source #

where F : Functor<F>

Terminal case for the free monad

Parameters

type F

Functor type

type A

Bound value type

param value

Terminal value

method Free<F, A> lift <F, A> (K<F, A> value) Source #

where F : Functor<F>

Lift the functor into the free monad

Parameters

type F

Functor type

type A

Bound value type

param value

Functor that yields a Free monad

method Free<F, A> bind <F, A> (K<F, Free<F, A>> value) Source #

where F : Functor<F>

Monadic bind case for the free monad

Parameters

type F

Functor type

type A

Bound value type

param value

Functor that yields a Free monad

class Free <F> Source #

where F : Functor<F>

Free monad makes any functor into a monad

class Prelude Source #

Methods

method Free<F, B> map <F, A, B> (Func<A, B> f, K<Free<F>, A> ma) Source #

where F : Functor<F>

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 Free<F, B> action <F, A, B> (K<Free<F>, A> ma, K<Free<F>, B> mb) Source #

where F : Functor<F>

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

method Free<F, B> apply <F, A, B> (K<Free<F>, Func<A, B>> mf, K<Free<F>, A> ma) Source #

where F : Functor<F>

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