public Task <bool> IsNone(TryOptionAsync <A> opt) =>
 opt.Map(x => false).IfNoneOrFail(true);
 public Func <Unit, Task <S> > FoldBack <S>(TryOptionAsync <A> ma, S state, Func <S, A, S> f) => _ =>
 ma.Map(a => f(state, a)).IfNoneOrFail(state);
 public Func <Unit, Task <int> > Count(TryOptionAsync <A> ma) => _ =>
 ma.Map(a => 1).IfNoneOrFail(0);
 public static TryOptionAsync <R> map <T, R>(TryOptionAsync <T> self, Func <T, R> mapper) =>
 self.Map(mapper);
示例#5
0
 public static EitherAsync <L, TryOptionAsync <B> > Sequence <L, A, B>(this TryOptionAsync <A> ta, Func <A, EitherAsync <L, B> > f) =>
 ta.Map(f).Sequence();
示例#6
0
 public static TryAsync <TryOptionAsync <B> > Sequence <A, B>(this TryOptionAsync <A> ta, Func <A, TryAsync <B> > f) =>
 ta.Map(f).Sequence();
示例#7
0
 public Task <bool> IsSomeAsync(TryOptionAsync <A> opt) =>
 opt.Map(x => true).IfNoneOrFail(false);
 public Task <int> GetHashCodeAsync(TryOptionAsync <A> x) =>
 x.Map(default(HashA).GetHashCode)
 .IfNoneOrFail(0);
示例#9
0
 public static ValueTask <TryOptionAsync <B> > Sequence <A, B>(this TryOptionAsync <A> ta, Func <A, ValueTask <B> > f) =>
 ta.Map(f).Sequence();
示例#10
0
 public static Aff <RT, TryOptionAsync <B> > Sequence <RT, A, B>(this TryOptionAsync <A> ta, Func <A, Aff <RT, B> > f)
     where RT : struct, HasCancel <RT> =>
 ta.Map(f).Sequence();