LanguageExt.Core

LanguageExt.Core Monads Free

Contents

Sub modules

Extensions
Operators
Prelude
Trait

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 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

method Free<G, A> hoist <F, G, A> (Free<F, A> fb) Source #

where F : Functor<F>, Natural<F, G>
where G : Functor<G>

Lift a natural transformation from F to G into a natural-transformation from Free F to Free G.

Parameters

type N

Natural transformation

type F

Functor

type G

Functor

type A

Bound value type

param fb

Free monad in F

returns

Free monad in G