public static Task <R> match <T, R>(TryAsync <T> self, Func <T, R> Succ, R Fail) => self.Match(Succ, Fail);
public Func <Unit, Task <S> > FoldBackAsync <S>(TryAsync <A> ma, S state, Func <S, A, Task <S> > f) => _ => default(MTryFirstAsync <A>).MatchAsync(ma, x => f(state, x), () => state);
public Task <bool> IsSome(TryAsync <A> opt) => Match(opt, Some: _ => true, None: () => false);
public Task <Unit> Match(TryAsync <A> opt, Action <A> Some, Action None) => Match(opt, x => { Some(x); return(unit); }, () => { None(); return(unit); });
public Task <Unit> MatchAsync(TryAsync <A> opt, Action <A> Some, Func <Task> NoneAsync) => MatchAsync(opt, x => { Some(x); return(unit); }, async() => { await NoneAsync().ConfigureAwait(false); return(unit); });
public static Task <Arr <T> > toArray <T>(TryAsync <T> tryDel) => tryDel.ToArray();
public static TryAsync <A> append <SEMI, A>(TryAsync <A> lhs, TryAsync <A> rhs) where SEMI : struct, Semigroup <A> => lhs.Append <SEMI, A>(rhs);
public static Task <int> count <T>(TryAsync <T> self) => self.Count();
public static Task <bool> exists <T>(TryAsync <T> self, Func <T, bool> pred) => self.Exists(pred);
public static Task <S> fold <S, T>(TryAsync <T> self, S state, Func <S, T, S> Succ, Func <S, Exception, S> Fail) => self.BiFold(state, Succ, Fail);
public static Task <bool> forall <T>(TryAsync <T> self, Func <T, bool> pred) => self.ForAll(pred);
public static Task <S> fold <S, T>(TryAsync <T> self, S state, Func <S, T, S> folder) => self.Fold(state, folder);
/// <summary> /// Invokes a delegate with the result of the TryAsync computation if it is successful. /// </summary> /// <typeparam name="T">Type of the bound value</typeparam> /// <param name="self">TryAsync computation</param> /// <param name="action">Delegate to invoke on successful invocation of the TryAsync computation</param> public static Task <Unit> iter <T>(TryAsync <T> self, Action <T> action) => self.Iter(action);
/// <summary> /// Pattern matches the two possible states of the TryAsync computation /// </summary> /// <typeparam name="T">Type of the bound value</typeparam> /// <param name="self">TryAsync computation</param> /// <param name="Succ">Delegate to invoke if the TryAsync computation completes successfully</param> /// <param name="Fail">Delegate to invoke if the TryAsync computation fails</param> public static Task <Unit> match <T>(TryAsync <T> self, Action <T> Succ, Action <Exception> Fail) => self.Match(Succ, Fail);
public static TryAsync <A> plusFirst <A>(TryAsync <A> ma, TryAsync <A> mb) => default(MTryFirstAsync <A>).Plus(ma, mb);
public static TryAsync <R> map <T, R>(TryAsync <T> self, Func <T, R> mapper) => self.Map(mapper);
public static Task <Lst <T> > toList <T>(TryAsync <T> tryDel) => tryDel.ToList();
public static TryAsync <R> bimap <T, R>(TryAsync <T> tryDel, Func <T, R> Succ, Func <Exception, R> Fail) => tryDel.BiMap(Succ, Fail);
public static TryAsync <A> choice <A>(TryAsync <A> ma, params TryAsync <A>[] tail) => choice(Cons(ma, tail));
public static TryAsync <Func <T2, Func <T3, R> > > parmap <T1, T2, T3, R>(TryAsync <T1> self, Func <T1, T2, T3, R> func) => self.ParMap(func);
public static TryAsync <A> add <NUM, A>(TryAsync <A> lhs, TryAsync <A> rhs) where NUM : struct, Num <A> => lhs.Add <NUM, A>(rhs);
public static TryAsync <T> filter <T>(TryAsync <T> self, Func <T, bool> pred) => self.Filter(pred);
public Task <Unit> MatchAsync(TryAsync <A> opt, Func <A, Task> SomeAsync, Action None) => MatchAsync(opt, async x => { await SomeAsync(x).ConfigureAwait(false); return(unit); }, () => { None(); return(unit); });
public static TryAsync <T> bifilter <T>(TryAsync <T> self, Func <T, bool> Succ, Func <Exception, bool> Fail) => self.BiFilter(Succ, Fail);
public Task <Unit> MatchAsync(TryAsync <A> opt, Func <A, Task> SomeAsync, Func <Task> NoneAsync) => MatchAsync(opt, async x => { await SomeAsync(x).ConfigureAwait(false); return(unit); }, async() => { await NoneAsync().ConfigureAwait(false); return(unit); });
public static TryAsync <R> bind <T, R>(TryAsync <T> tryDel, Func <T, TryAsync <R> > binder) => tryDel.Bind(binder);
public Func <Unit, Task <int> > Count(TryAsync <A> ma) => _ => default(MTryFirstAsync <A>).Match(ma, x => 1, () => 0);
public static TryAsync <R> bibind <T, R>(TryAsync <T> self, Func <T, TryAsync <R> > Succ, Func <Exception, TryAsync <R> > Fail) => self.BiBind(Succ, Fail);
public TryAsync <A> Append(TryAsync <A> x, TryAsync <A> y) => Plus(x, y);
public static TryAsync <T> flatten <T>(TryAsync <TryAsync <TryAsync <TryAsync <T> > > > self) => self.Flatten();