LanguageExt.Core

LanguageExt.Core Monads

Not all of the monadic types are in this section, but most of them are. The other monadic types are the collections, and the effect-system monads of IO, Eff, StreamT, and Proxy.

Contents

Sub modules

Alternative Monads
ContT
Free
Identity
IdentityT
Lifting
Monadic conditionals
Pure and Fail
State and Environment Monads
Trampoline

class Prelude Source #

Methods

method Identity<A> Id <A> (A value) Source #

Construct identity monad

method Pure<A> Pure <A> (A value) Source #

Create a new Pure monad. This monad doesn't do much, but when combined with other monads, it allows for easier construction of pure lifted values.

There are various bind operators that make it work with these types:

* Option
* Eff
* Either
* Fin
* IO
* Validation

Parameters

type A

Bound value type

param value

Value to lift

returns

Pure monad

method Fail<E> Fail <E> (E error) Source #

Create a new Fail monad: the monad that always fails. This monad doesn't do much, but when combined with other monads, it allows for easier construction of lifted failure values.

There are various bind operators that make it work with these types:

* Option
* Eff
* Either
* Fin
* IO
* Validation

Parameters

type A

Bound value type

param value

Value to lift

returns

Pure monad

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

where F : Applicative<F>

Construct an applicative structure from a pure value

Parameters

type A

Bound value type

param value

Pure value to lift into the applicative structure

returns

Applicative structure

method K<F, A> fail <E, F, A> (E error) Source #

where F : Fallible<E, F>

Construct a structure F in a failed state

Parameters

type E

Error type

type F

Structure to construct

type A

Bound value type

param error

Failure value

returns

F structure in a failed state

method K<F, Unit> fail <E, F> (E error) Source #

where F : Fallible<E, F>

Construct a structure F in a failed state

Parameters

type E

Error type

type F

Structure to construct

param error

Failure value

returns

F structure in a failed state

method K<F, A> error <F, A> (Error error) Source #

where F : Fallible<F>

Construct a structure F in a failed state

Parameters

type F

Structure to construct

type A

Bound value type

param error

Failure value

returns

F structure in a failed state

method K<F, Unit> error <F> (Error error) Source #

where F : Fallible<F>

Construct a structure F in a failed state

Parameters

type F

Structure to construct

param error

Failure value

returns

F structure in a failed state