LanguageExt.Core

LanguageExt.Core Traits Functor Extensions

Contents

class FunctorExtensions Source #

Methods

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

where F : Functor<F>, Fallible<E, F>

Monad bind operation

Parameters

type F

Functor trait

type B

Intermediate bound value type

type C

Target bound value type

param bind

Monadic bind function

param project

Projection function

returns

M〈C〉

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〈int〉〉(Some(1), Some(2), Some(3)); var ma = mx.MapT(a => a + 1);

class FunctorExtensions Source #

Methods

method K<FF, B> Map <B> (Func<A, B> f) Source #