Пример #1
0
 public static Aff <Identity <A> > Sequence <A>(this Identity <Aff <A> > ta) =>
 ta.Traverse(identity);
Пример #2
0
 public static TryAsync <Identity <B> > Sequence <A, B>(this Identity <A> ta, Func <A, TryAsync <B> > f) =>
 ta.Map(f).Traverse(Prelude.identity);
Пример #3
0
 public static Identity <Identity <B> > Traverse <A, B>(this Identity <Identity <A> > ma, Func <A, B> f) =>
 new Identity <Identity <B> >(new Identity <B>(f(ma.Value.Value)));
Пример #4
0
 public static Arr <Identity <B> > Traverse <A, B>(this Identity <Arr <A> > ma, Func <A, B> f) =>
 ma.Value.Map(a => Id <B>(f(a)));
Пример #5
0
 public static OptionUnsafe <Identity <B> > Traverse <A, B>(this Identity <OptionUnsafe <A> > ma, Func <A, B> f) =>
 ma.Value.IsSome
         ? OptionUnsafe <Identity <B> > .Some(new Identity <B>(f(ma.Value.Value)))
         : OptionUnsafe <Identity <B> > .None;
Пример #6
0
 public static HashSet <Identity <A> > Sequence <A>(this Identity <HashSet <A> > ta) =>
 ta.Traverse(identity);
Пример #7
0
 public static Validation <MonoidFail, Fail, Identity <B> > Traverse <MonoidFail, Fail, A, B>(this Identity <Validation <MonoidFail, Fail, A> > ma, Func <A, B> f)
     where MonoidFail : struct, Monoid <Fail>, Eq <Fail>
 {
     if (ma.Value.IsFail)
     {
         return(Validation <MonoidFail, Fail, Identity <B> > .Fail(ma.Value.FailValue));
     }
     else
     {
         return(Validation <MonoidFail, Fail, Identity <B> > .Success(Id <B>(f((A)ma.Value))));
     }
 }
Пример #8
0
 public static Either <L, Identity <A> > Sequence <L, A>(this Identity <Either <L, A> > ta) =>
 ta.Traverse(identity);
Пример #9
0
 public static Aff <RT, Identity <A> > Sequence <RT, A>(this Identity <Aff <RT, A> > mma)
     where RT : struct, HasCancel <RT> =>
 mma.Traverse(identity);
Пример #10
0
 public static Aff <RT, Identity <B> > Sequence <RT, A, B>(this Identity <A> ta, Func <A, Aff <RT, B> > f)
     where RT : struct, HasCancel <RT> =>
 ta.Map(f).Traverse(Prelude.identity);
Пример #11
0
 public static Validation <MonoidFail, Fail, Identity <B> > Sequence <MonoidFail, Fail, A, B>(this Identity <A> ta, Func <A, Validation <MonoidFail, Fail, B> > f)
     where MonoidFail : struct, Monoid <Fail>, Eq <Fail> =>
 ta.Map(f).Traverse(Prelude.identity);
Пример #12
0
 public int CompareTo(Identity <A> other) =>
 default(OrdDefault <A>).Compare(value, other.value);
Пример #13
0
 public bool Equals(Identity <A> other) =>
 default(EqDefault <A>).Equals(value, other.value) && IsBottom == other.IsBottom;
Пример #14
0
 public static Option <Identity <B> > Sequence <A, B>(this Identity <A> ta, Func <A, Option <B> > f) =>
 ta.Map(f).Traverse(Prelude.identity);
Пример #15
0
 public static async Task <Identity <B> > Traverse <A, B>(this Identity <Task <A> > ma, Func <A, B> f) =>
 new Identity <B>(f(await ma.Value));