LanguageExt.Core

LanguageExt.Core Monads Alternative Monads Fin Extensions

Contents

class FinExtensions Source #

Methods

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

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

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

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

method Fin<B> Apply <A, B> (this Fin<Func<A, B>> mf, K<Fin, 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

method Fin<B> Apply <A, B> (this K<Fin, Func<A, B>> mf, K<Fin, 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

class FinExtensions Source #

Extension methods for Fin

Methods

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

method Fin<A> ToFin <A> (this Either<Error, A> ma) Source #

Natural transformation from Either to Fin

method Fin<R> Flatten <R> (this Fin<Fin<R>> ma) Source #

Monadic join

method Fin<R> Plus <NUM, R> (this Fin<R> x, Fin<R> y) Source #

where NUM : Arithmetic<R>

Add the bound values of x and y, uses an Add trait to provide the add operation for type A. For example x.Add〈TInteger, int〉(y)

Parameters

type NUM

Num of A

type A

Bound value type

param x

Left hand side of the operation

param y

Right hand side of the operation

returns

Fin with y added to x

method Fin<R> Subtract <NUM, R> (this Fin<R> x, Fin<R> y) Source #

where NUM : Arithmetic<R>

Find the difference between the two bound values of x and y, uses a Subtract trait to provide the subtract operation for type A. For example x.Subtract〈TInteger, int〉(y)

Parameters

type NUM

Num of A

type A

Bound value type

param x

Left hand side of the operation

param y

Right hand side of the operation

returns

Fin with the difference between x and y

method Fin<R> Product <NUM, R> (this Fin<R> x, Fin<R> y) Source #

where NUM : Arithmetic<R>

Find the product between the two bound values of x and y, uses a Product trait to provide the product operation for type A. For example x.Product〈TInteger, int〉(y)

Parameters

type NUM

Num of A

type A

Bound value type

param x

Left hand side of the operation

param y

Right hand side of the operation

returns

Fin with the product of x and y

method Fin<R> Divide <NUM, R> (this Fin<R> x, Fin<R> y) Source #

where NUM : Num<R>

Divide the two bound values of x and y, uses a Divide trait to provide the divide operation for type A. For example x.Divide〈TDouble, double〉(y)

Parameters

type NUM

Num of A

type A

Bound value type

param x

Left hand side of the operation

param y

Right hand side of the operation

returns

Fin x / y

method (Seq<Error> Fails, Seq<A> Succs) Partition <F, A> (this K<F, Fin<A>> self) Source #

where F : Foldable<F>

Partitions a foldable of Fin into two sequences.

All the Fail elements are extracted, in order, to the first component of the output. Similarly, the Succ elements are extracted to the second component of the output.

Parameters

returns

A pair containing the sequences of partitioned values

method Seq<Error> Fails <F, A> (this K<F, Fin<A>> self) Source #

where F : Foldable<F>

Partitions a foldable of Fin into two lists and returns the Fail items only.

Parameters

returns

A sequence of partitioned items

method Seq<A> Succs <F, A> (this K<F, Fin<A>> self) Source #

where F : Foldable<F>

Partitions a foldable of Fin into two lists and returns the Succ items only.

Parameters

returns

A sequence of partitioned items

class FinExtensions Source #

Methods

method Fin<B> Map <A, B> (this Func<A, B> f, K<Fin, 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 Fin<B> Map <A, B> (this Func<A, B> f, Fin<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

class FinGuardExtensions Source #

Methods

method Fin<Unit> ToFin (this Guard<Error, Unit> ma) Source #

Natural transformation to Fin

method Fin<B> Bind <B> ( this Guard<Error, Unit> guard, Func<Unit, Fin<B>> f) Source #

Monadic binding support for Fin

method Fin<B> SelectMany <B> (this Guard<Error, Unit> ma, Func<Unit, Fin<B>> f) Source #

Monadic binding support for Fin

method Fin<C> SelectMany <B, C> ( this Guard<Error, Unit> ma, Func<Unit, Fin<B>> bind, Func<Unit, B, C> project) Source #

Monadic binding support for Fin