Method Select
- Namespace
- SodaFlow.Functional
- Assembly
- SodaFlow.Functional.dll
Select<T, TResult>(Maybe<T>, Func<T, TResult>)
Implements the LINQ select operation for the Maybe<T> monad.
public static Maybe<TResult> Select<T, TResult>(this Maybe<T> value, Func<T, TResult> transformation)
Parameters
valueMaybe<T>The Maybe<T> value to transform.
transformationFunc<T, TResult>The transformation function, which takes a value of type
Tcontained in the monad and transforms it into a value of typeTResult.
Returns
Type Parameters
TThe type of the value contained in the monad to transform.
TResultThe type of the value contained in the resulting monad.
Remarks
The same operation as Map<TResult>(Func<T, TResult>), with the name
the compiler looks for. It is what lets a Maybe<T> be the
source of a query expression, so that from x in m select f(x)
compiles.