LanguageExt.Core

LanguageExt.Core Traits Functor

Contents

class FunctorExtensions Source #

Methods

method K<F, C> SelectMany <F, A, C> ( this K<F, A> ma, Func<A, Guard<Error, Unit>> bind, Func<A, Unit, C> project) Source #

where F : Functor<F>

Monad bind operation

Parameters

type A

Initial bound value type

type C

Target bound value type

param bind

Monadic bind function

param project

Projection function

returns

M

method K<F, C> SelectMany <F, A, C> ( this K<F, A> ma, Func<A, Guard<Fail<Error>, Unit>> bind, Func<A, Unit, C> project) Source #

where F : Functor<F>

Monad bind operation

Parameters

type A

Initial bound value type

type C

Target bound value type

param bind

Monadic bind function

param project

Projection function

returns

M

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

where F : Functor<F>

Monad bind operation

Parameters

type B

Intermediate bound value type

type C

Target bound value type

param bind

Monadic bind function

param project

Projection function

returns

M

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

where F : Functor<F>

Monad bind operation

Parameters

type B

Intermediate bound value type

type C

Target bound value type

param bind

Monadic bind function

param project

Projection function

returns

M

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

where Fnctr : Functor<Fnctr>

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

type Fnctr

Trait of the functor

param ma

Functor to map

param f

Mapping function

returns

Mapped functor

method K<Fnctr, B> Select <Fnctr, A, B> ( this K<Fnctr, A> ma, Func<A, B> f) Source #

where Fnctr : Functor<Fnctr>

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

type Fnctr

Trait of the functor

param ma

Functor to map

param f

Mapping function

returns

Mapped functor

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

where Fnctr : Functor<Fnctr>

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

type Fnctr

Trait of the functor

param ma

Functor to map

param f

Mapping function

returns

Mapped functor

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

where Fnctr : Functor<Fnctr>

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.

This variant takes the passed function and partially applies it, so the result is a functor within the value being the partially applied function. If Fnctr is also an Applicative, which is often the case, you can provide further arguments to the partially applied function by calling .Apply() on the resulting functor.

You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.

Parameters

type Fnctr

Trait of the functor

param ma

Functor to map

param f

Mapping function

returns

Mapped functor

method K<Fnctr, Func<B, Func<C, D>>> Map <Fnctr, A, B, C, D> ( this Func<A, B, C, D> f, K<Fnctr, A> ma) Source #

where Fnctr : Functor<Fnctr>

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.

This variant takes the passed function and partially applies it, so the result is a functor within the value being the partially applied function. If Fnctr is also an Applicative, which is often the case, you can provide further arguments to the partially applied function by calling .Apply() on the resulting functor.

You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.

Parameters

type Fnctr

Trait of the functor

param ma

Functor to map

param f

Mapping function

returns

Mapped functor

method K<Fnctr, Func<B, Func<C, Func<D, E>>>> Map <Fnctr, A, B, C, D, E> ( this Func<A, B, C, D, E> f, K<Fnctr, A> ma) Source #

where Fnctr : Functor<Fnctr>

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.

This variant takes the passed function and partially applies it, so the result is a functor within the value being the partially applied function. If Fnctr is also an Applicative, which is often the case, you can provide further arguments to the partially applied function by calling .Apply() on the resulting functor.

You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.

Parameters

type Fnctr

Trait of the functor

param ma

Functor to map

param f

Mapping function

returns

Mapped functor

method K<Fnctr, Func<B, Func<C, Func<D, Func<E, F>>>>> Map <Fnctr, A, B, C, D, E, F> ( this Func<A, B, C, D, E, F> f, K<Fnctr, A> ma) Source #

where Fnctr : Functor<Fnctr>

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.

This variant takes the passed function and partially applies it, so the result is a functor within the value being the partially applied function. If Fnctr is also an Applicative, which is often the case, you can provide further arguments to the partially applied function by calling .Apply() on the resulting functor.

You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.

Parameters

type Fnctr

Trait of the functor

param ma

Functor to map

param f

Mapping function

returns

Mapped functor

method K<Fnctr, Func<B, Func<C, Func<D, Func<E, Func<F, G>>>>>> Map <Fnctr, A, B, C, D, E, F, G> ( this Func<A, B, C, D, E, F, G> f, K<Fnctr, A> ma) Source #

where Fnctr : Functor<Fnctr>

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.

This variant takes the passed function and partially applies it, so the result is a functor within the value being the partially applied function. If Fnctr is also an Applicative, which is often the case, you can provide further arguments to the partially applied function by calling .Apply() on the resulting functor.

You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.

Parameters

type Fnctr

Trait of the functor

param ma

Functor to map

param f

Mapping function

returns

Mapped functor

method K<Fnctr, Func<B, Func<C, Func<D, Func<E, Func<F, Func<G, H>>>>>>> Map <Fnctr, A, B, C, D, E, F, G, H> ( this Func<A, B, C, D, E, F, G, H> f, K<Fnctr, A> ma) Source #

where Fnctr : Functor<Fnctr>

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.

This variant takes the passed function and partially applies it, so the result is a functor within the value being the partially applied function. If Fnctr is also an Applicative, which is often the case, you can provide further arguments to the partially applied function by calling .Apply() on the resulting functor.

You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.

Parameters

type Fnctr

Trait of the functor

param ma

Functor to map

param f

Mapping function

returns

Mapped functor

method K<Fnctr, Func<B, Func<C, Func<D, Func<E, Func<F, Func<G, Func<H, I>>>>>>>> Map <Fnctr, A, B, C, D, E, F, G, H, I> ( this Func<A, B, C, D, E, F, G, H, I> f, K<Fnctr, A> ma) Source #

where Fnctr : Functor<Fnctr>

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.

This variant takes the passed function and partially applies it, so the result is a functor within the value being the partially applied function. If Fnctr is also an Applicative, which is often the case, you can provide further arguments to the partially applied function by calling .Apply() on the resulting functor.

You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.

Parameters

type Fnctr

Trait of the functor

param ma

Functor to map

param f

Mapping function

returns

Mapped functor

method K<Fnctr, Func<B, Func<C, Func<D, Func<E, Func<F, Func<G, Func<H, Func<I, J>>>>>>>>> Map <Fnctr, A, B, C, D, E, F, G, H, I, J> ( this Func<A, B, C, D, E, F, G, H, I, J> f, K<Fnctr, A> ma) Source #

where Fnctr : Functor<Fnctr>

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.

This variant takes the passed function and partially applies it, so the result is a functor within the value being the partially applied function. If Fnctr is also an Applicative, which is often the case, you can provide further arguments to the partially applied function by calling .Apply() on the resulting functor.

You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.

Parameters

type Fnctr

Trait of the functor

param ma

Functor to map

param f

Mapping function

returns

Mapped functor

method K<Fnctr, Func<B, Func<C, Func<D, Func<E, Func<F, Func<G, Func<H, Func<I, Func<J, K>>>>>>>>>> Map <Fnctr, A, B, C, D, E, F, G, H, I, J, K> ( this Func<A, B, C, D, E, F, G, H, I, J, K> f, K<Fnctr, A> ma) Source #

where Fnctr : Functor<Fnctr>

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.

This variant takes the passed function and partially applies it, so the result is a functor within the value being the partially applied function. If Fnctr is also an Applicative, which is often the case, you can provide further arguments to the partially applied function by calling .Apply() on the resulting functor.

You can continue this until all arguments have been provided and then you'll have a functor within the result of the function wrapped up inside.

Parameters

type Fnctr

Trait of the functor

param ma

Functor to map

param f

Mapping function

returns

Mapped functor

class FunctorExtensions Source #

Methods

method K<M, K<N, B>> MapT <M, N, A, B> (this K<M, K<N, A>> mna, Func<A, B> f) Source #

where M : Functor<M>
where N : Functor<N>

Runs a functor map operation on the nested functors

If you're working with an inner functor that is concrete then you will first need to call KindT to cast the functor to a more general K version. This enables the T variant extensions (like BindT, `MapT, etc.) to work without providing excessive generic arguments all the way down the chain.

Parameters

type NA

N<A>

type M

Outer functor trait

type N

Inner functor trait

type A

Input bound value

type B

Output bound value

param mna

Nested functor value

param f

Bind function

returns

Mapped value

Examples

var mx = Seq<Option>(Some(1), Some(2), Some(3));

var ma = mx.KindT<Seq, Option, Option, int>() .BindT(a => Some(a + 1)) .MapT(a => a + 1); .AsT<Seq, Option, Option, int>();

class Functor Source #

Functor module

Methods

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

where F : Functor<F>

interface Functor <F> Source #

where F : Functor<F>

Functor trait

Map is used to apply a function of type Func<A, B> to a value of type K<F, A> where F is a functor, to produce a value of type K<F, B>.

Note that for any type type with more than one parameter (e.g., Either), only the last type parameter can be modified with Map (e.g. R in Either<L, R>).

Some types two generic parameters or more have a Bifunctor instance that allows both the last and the penultimate parameters to be mapped over.

Parameters

type F

Self referring type

Methods

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

type Fnctr

Trait of the functor

param f

Mapping function

param ma

Functor to map

returns

Mapped functor