public static Option <A> AsOption <A>(this Try <A> either, Action <Exception> callback) => either.Else(Option <A> .Return, e => { callback(e); return(Option <A> .None); });
public static Either <A, Error> AsEither <A, Error>(this Try <A> either, Func <Exception, Error> errorMap) => either.Else(Either <A, Error> .Create, ex => errorMap(ex));
public static A ElseThrow <A>(this Try <A> either) { return(either.Else(exc => { throw exc; })); }