Trans<OuterMonad, OuterType, InnerMonad, InnerType, A> Struct

Default monad transformer, can nest any two monadic types and provide the correct default behaviour based on their Bind operations.

i.e.


Trans<MLst<Option<int>>, Lst<Option<int>>, MOption<int>, Option<int>, int>


DECLARATION
public struct Trans<OuterMonad, OuterType, InnerMonad, InnerType, A> : MonadTrans<OuterMonad, OuterType, InnerMonad, InnerType, A>
NAMESPACE
LanguageExt

Fields

Inst
DECLARATION
public static readonly Trans<OuterMonad, OuterType, InnerMonad, InnerType, A> Inst

Methods

Bind<NewOuterMonad, NewOuterType, NewInnerMonad, NewInnerType, B>(OuterType, Func<A, NewInnerType>)
PARAMETERS
ma
OuterType
f
Func<A, NewInnerType>
DECLARATION
public NewOuterType Bind<NewOuterMonad, NewOuterType, NewInnerMonad, NewInnerType, B>(OuterType ma, Func<A, NewInnerType> f)
RETURNS
NewOuterType
CONSTRAINTS
where NewOuterMonad : struct Monad<NewOuterType, NewInnerType>
where NewInnerMonad : struct Monad<NewInnerType, B>
Bind<NewOuterMonad, NewOuterType, NewInnerMonad, NewInnerType, B>(OuterType, Func<A, NewOuterType>)
PARAMETERS
ma
OuterType
f
Func<A, NewOuterType>
DECLARATION
public NewOuterType Bind<NewOuterMonad, NewOuterType, NewInnerMonad, NewInnerType, B>(OuterType ma, Func<A, NewOuterType> f)
RETURNS
NewOuterType
CONSTRAINTS
where NewOuterMonad : struct Monad<NewOuterType, NewInnerType>
where NewInnerMonad : struct Monad<NewInnerType, B>
Count(OuterType)
PARAMETERS
ma
OuterType
DECLARATION
public int Count(OuterType ma)
RETURNS
int
Fold<S>(OuterType, S, Func<S, A, S>)
PARAMETERS
ma
OuterType
state
S
f
Func<S, A, S>
DECLARATION
public S Fold<S>(OuterType ma, S state, Func<S, A, S> f)
RETURNS
S
FoldBack<S>(OuterType, S, Func<S, A, S>)
PARAMETERS
ma
OuterType
state
S
f
Func<S, A, S>
DECLARATION
public S FoldBack<S>(OuterType ma, S state, Func<S, A, S> f)
RETURNS
S
Map<NewOuterMonad, NewOuterType, NewInnerMonad, NewInnerType, B>(OuterType, Func<A, B>)
PARAMETERS
ma
OuterType
f
Func<A, B>
DECLARATION
public NewOuterType Map<NewOuterMonad, NewOuterType, NewInnerMonad, NewInnerType, B>(OuterType ma, Func<A, B> f)
RETURNS
NewOuterType
CONSTRAINTS
where NewOuterMonad : struct Monad<NewOuterType, NewInnerType>
where NewInnerMonad : struct Monad<NewInnerType, B>
Plus(OuterType, OuterType)
PARAMETERS
ma
OuterType
mb
OuterType
DECLARATION
public OuterType Plus(OuterType ma, OuterType mb)
RETURNS
OuterType
Sequence<NewOuterMonad, NewOuterType, NewInnerMonad, NewInnerType>(OuterType)
PARAMETERS
ma
OuterType
DECLARATION
public NewOuterType Sequence<NewOuterMonad, NewOuterType, NewInnerMonad, NewInnerType>(OuterType ma)
RETURNS
NewOuterType
CONSTRAINTS
where NewOuterMonad : struct Monad<NewOuterType, NewInnerType>
where NewInnerMonad : struct Monad<NewInnerType, A>
Traverse<NewOuterMonad, NewOuterType, NewInnerMonad, NewInnerType, B>(OuterType, Func<A, B>)
PARAMETERS
ma
OuterType
f
Func<A, B>
DECLARATION
public NewOuterType Traverse<NewOuterMonad, NewOuterType, NewInnerMonad, NewInnerType, B>(OuterType ma, Func<A, B> f)
RETURNS
NewOuterType
CONSTRAINTS
where NewOuterMonad : struct Monad<NewOuterType, NewInnerType>
where NewInnerMonad : struct Monad<NewInnerType, B>
Zero()
DECLARATION
public OuterType Zero()
RETURNS
OuterType