LanguageExt.Core

LanguageExt.Core Monads Identity

Contents

record Identity <A> (A Value) Source #

Identity monad

Simply carries the bound value through its bind expressions without imparting any additional behaviours. It can be constructed using:

Identity〈int〉 ma = Id(123);

Parameters

type A

Bound value type

Methods

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

method K<F, Identity<B>> Traverse <F, B> (Func<A, K<F, B>> f) Source #

where F : Applicative<F>

Map each element of a structure to an action, evaluate these actions from left to right, and collect the results.

Parameters

type F

Applicative functor trait

type B

Bound value (output)

param f
param ta

Traversable structure

method K<M, Identity<B>> TraverseM <M, B> (Func<A, K<M, B>> f) Source #

where M : Monad<M>

Map each element of a structure to an action, evaluate these actions from left to right, and collect the results.

Parameters

type M

Monad trait

type B

Bound value (output)

param f
param ta

Traversable structure

method bool Equals (Identity<A>? other) Source #

method int GetHashCode () Source #

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

method Identity<B> Select <B> (Func<A, B> f) Source #

method Identity<B> Bind <B> (Func<A, Identity<B>> f) Source #

method Identity<B> Bind <B> (Func<A, K<Identity, B>> f) Source #

method Identity<C> SelectMany <B, C> (Func<A, Identity<B>> bind, Func<A, B, C> project) Source #

method Identity<C> SelectMany <B, C> (Func<A, K<Identity, B>> bind, Func<A, B, C> project) Source #

method int CompareTo (Identity<A>? other) Source #

class IdentityExt Source #

Methods

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

method A Run <A> (this K<Identity, A> ma) Source #

class Identity Source #

Identity trait implementation

Methods

method K<Identity, A> Pure <A> (A value) Source #

method Identity<B> bind <A, B> (Identity<A> ma, Func<A, Identity<B>> f) Source #

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

method Identity<B> apply <A, B> (Identity<Func<A, B>> mf, Identity<A> ma) Source #

method Identity<B> action <A, B> (Identity<A> ma, Identity<B> mb) Source #

method S fold <A, S> (Func<A, Func<S, S>> f, S initialState, K<Identity, A> ta) Source #

method S foldBack <A, S> (Func<S, Func<A, S>> f, S initialState, K<Identity, A> ta) Source #

method K<F, K<Identity, B>> traverse <F, A, B> (Func<A, K<F, B>> f, K<Identity, A> ta) Source #

where F : Applicative<F>