Ejemplo n.º 1
0
 Exception ExceptionOrDefault(Exceptional <T> ex)
 => ex.Match(exc => exc, _ => default(Exception));
Ejemplo n.º 2
0
 bool IsSuccess(Exceptional <T> ex)
 => ex.Match(_ => false, _ => true);
Ejemplo n.º 3
0
 T ValueOrDefault(Exceptional <T> ex)
 => ex.Match(exc => default(T), t => t);
Ejemplo n.º 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<R>)e),
       Success: t => from r in f(t) select Exceptional(r));