Esempio n. 1
0
 public static EitherAsync <L, TryAsync <B> > Sequence <L, A, B>(this TryAsync <A> ta, Func <A, EitherAsync <L, B> > f) =>
 ta.Map(f).Sequence();
Esempio n. 2
0
 public static Task <bool> Exists <A>(this TryAsync <A> self, Func <A, bool> pred) =>
 self.Map(pred).IfFail(false);
Esempio n. 3
0
 public static TryAsync <TryAsync <B> > Sequence <A, B>(this TryAsync <A> ta, Func <A, TryAsync <B> > f) =>
 ta.Map(f).Sequence();
Esempio n. 4
0
 public static TryAsync <Func <B, Func <C, R> > > ParMap <A, B, C, R>(this TryAsync <A> self, Func <A, B, C, R> func) =>
 self.Map(curry(func));
Esempio n. 5
0
 public Task <int> GetHashCode(TryAsync <A> x) =>
 x.Map(default(EqA).GetHashCode).IfFail(0);
Esempio n. 6
0
 public static TryAsync <R> map <T, R>(TryAsync <T> self, Func <T, R> mapper) =>
 self.Map(mapper);
 /// <summary>
 /// Impure iteration of the bound value in the structure
 /// </summary>
 /// <returns>
 /// Returns the original unmodified structure
 /// </returns>
 public static TryAsync <A> Do <A>(this TryAsync <A> ma, Action <A> f) =>
 ma.Map(x => { f(x); return(x); });
Esempio n. 8
0
 public static ValueTask <TryAsync <B> > Sequence <A, B>(this TryAsync <A> ta, Func <A, ValueTask <B> > f) =>
 ta.Map(f).Sequence();
Esempio n. 9
0
 public static Aff <RT, TryAsync <B> > Sequence <RT, A, B>(this TryAsync <A> ta, Func <A, Aff <RT, B> > f)
     where RT : struct, HasCancel <RT> =>
 ta.Map(f).Sequence();