Example #1
0
 public static T PureOrGet <T>(this Maybe <T> maybe, Func <T> else_func) =>
 maybe.HasValue
         ? maybe.Value
         : else_func();
Example #2
0
 public static T PureOrThrow <T>(this Maybe <T> maybe, Exception else_exception) =>
 maybe.HasValue
         ? maybe.Value
         : throw else_exception;
Example #3
0
 public static T PureOr <T>(this Maybe <T> maybe, T else_value) =>
 maybe.HasValue
         ? maybe.Value
         : else_value;