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
valueMaybe<T1>The Maybe<T> value to transform.
transformationFunc<T1, Maybe<T2>>The transformation function, which takes a value of type
T1contained in the monad and transforms it into a new monad of type Maybe<T>.collationFunc<T1, T2, TResult>The collation function, which takes a value of type
T1and a value of typeT2and combines them into a value of typeTResult.
Returns
- Maybe<TResult>
The Maybe<T> which results from transforming
valueusingtransformationand then collating usingcollation.
Type Parameters
T1The type of the value contained in the monad to transform.
T2The type of the value contained in the monad resulting from the transformation.
TResultThe type of the value contained in the monad resulting from collation.