LanguageExt.Core

LanguageExt.Core Monads Alternative Monads Either Prelude

Contents

class Prelude Source #

Methods

method Either<L, R> Right <L, R> (R value) Source #

Either constructor Constructs an Either in a Right state

Parameters

type L

Left

type R

Right

param value

Right value

returns

A new Either instance

method Pure<R> Right <R> (R value) Source #

Constructs an EitherRight which can be implicitly cast to an Either〈_, R〉

Parameters

type R

Right

param value

Right value

returns

A new EitherRight instance

method Either<L, R> Left <L, R> (L value) Source #

Either constructor Constructs an Either in a Left state

Parameters

type L

Left

type R

Right

param value

Left value

returns

A new Either instance

method Fail<L> Left <L> (L value) Source #

Constructs an EitherLeft which can be implicitly cast to an Either〈L, _〉

Parameters

type L

Left

param value

Right value

returns

A new EitherLeft instance

class Prelude Source #

Methods

method Either<L, B> map <L, A, B> (Func<A, B> f, K<Either<L>, A> ma) Source #

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

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

method Either<L, B> apply <L, A, B> (K<Either<L>, Func<A, B>> mf, K<Either<L>, A> ma) Source #

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