Table of Contents

Method SelectMany

Namespace
SodaFlow.Functional
Assembly
SodaFlow.Functional.dll

SelectMany<T1, T2, TResult>(Maybe<T1>, Func<T1, Maybe<T2>>, Func<T1, T2, TResult>)

Implements the LINQ select many operation for the Maybe<T> monad.

public static Maybe<TResult> SelectMany<T1, T2, TResult>(this Maybe<T1> value, Func<T1, Maybe<T2>> transformation, Func<T1, T2, TResult> collation)

Parameters

value Maybe<T1>

The Maybe<T> value to transform.

transformation Func<T1, Maybe<T2>>

The transformation function, which takes a value of type T1 contained in the monad and transforms it into a new monad of type Maybe<T>.

collation Func<T1, T2, TResult>

The collation function, which takes a value of type T1 and a value of type T2 and combines them into a value of type TResult.

Returns

Maybe<TResult>

The Maybe<T> which results from transforming value using transformation and then collating using collation.

Type Parameters

T1

The type of the value contained in the monad to transform.

T2

The type of the value contained in the monad resulting from the transformation.

TResult

The type of the value contained in the monad resulting from collation.