OptTMatchTOut(FuncT, TOut, FuncTOut) Method
Maps into
whenSome(Unwrap()) whenever IsSome; and into lazy
whenNone() otherwise.
Similar to
MatchTOut(FuncT, TOut, TOut) except that None variant is evaluated only when IsNone.
// assuming QueryAnonymousGreeting() is expensive.
Opt<User> user = GetOptionalUser(..);
string greeting = user.Match(u => $"Welcome back {u.Name}", () => QueryAnonymousGreeting());
Namespace: Orx.Fun.OptionAssembly: Orx.Fun.Option (in Orx.Fun.Option.dll) Version: 1.2.1+ea79806fa5e0e04bfdaef2a1916930e75e2cde74
public TOut Match<TOut>(
Func<T, TOut> whenSome,
Func<TOut> whenNone
)
- whenSome FuncT, TOut
- Mapping function (T -> TOut) that will be called with Unwrapped value to get the return value when Some.
- whenNone FuncTOut
- Function to be called lazily to get the return value when None.
- TOut
[Missing <typeparam name="TOut"/> documentation for "M:Orx.Fun.Option.Opt`1.Match``1(System.Func{`0,``0},System.Func{``0})"]
TOut