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