Method Map
- Namespace
- SodaFlow.Functional
- Assembly
- SodaFlow.Functional.dll
Map<T, TResult>(Task<Maybe<T>>, Func<T, TResult>)
Transforms the value the task will give, if it gives one.
public static Task<Maybe<TResult>> Map<T, TResult>(this Task<Maybe<T>> a, Func<T, TResult> f)
Parameters
aTask<Maybe<T>>The task giving the value to transform.
fFunc<T, TResult>Run with the contained value when there is one.
Returns
- Task<Maybe<TResult>>
A task giving a Maybe<T> containing the result of
fif the awaited value contained one, and one containing no value otherwise.
Type Parameters
TThe type of the value, when there is one.
TResultThe type of the value the function produces.