Exception ExceptionOrDefault(Exceptional <T> ex)
 => ex.Match(exc => exc, _ => default(Exception));
 bool IsSuccess(Exceptional <T> ex)
 => ex.Match(_ => false, _ => true);
 T ValueOrDefault(Exceptional <T> ex)
 => ex.Match(exc => default(T), t => t);
Пример #4
0
 public static Validation <Exceptional <R> > Traverse <T, R>
     (this Exceptional <T> tr, Func <T, Validation <R> > f)
 => tr.Match(
     Exception: e => Valid(Exceptional.Of <R>(e)),
     Success: t => from r in f(t) select Exceptional.Of(r));