Method Match
- Namespace
- SodaFlow.Functional
- Assembly
- SodaFlow.Functional.dll
Match<T>(Func<object?, T>, Func<T>)
Runs one function when there is a value, and a different one when there is none.
T Match<T>(Func<object?, T> onSome, Func<T> onNone)
Parameters
onSomeFunc<object, T>Run with the contained value when there is one.
onNoneFunc<T>Run when there is no value.
Returns
- T
Whatever the function that was run returned.
Type Parameters
TThe type each of the two functions returns.
Remarks
This calls one function of the two, and it calls that function before this method returns. This is the primitive that expresses all the other members of the interface.