Esempio n. 1
0
 public static Aff <Identity <A> > Sequence <A>(this Identity <Aff <A> > ta) =>
 ta.Traverse(identity);
Esempio n. 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);
Esempio n. 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)));
Esempio n. 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)));
Esempio n. 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;
Esempio n. 6
0
 public static HashSet <Identity <A> > Sequence <A>(this Identity <HashSet <A> > ta) =>
 ta.Traverse(identity);
Esempio n. 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))));
     }
 }
Esempio n. 8
0
 public static Either <L, Identity <A> > Sequence <L, A>(this Identity <Either <L, A> > ta) =>
 ta.Traverse(identity);
Esempio n. 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);
Esempio n. 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);
Esempio n. 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);
Esempio n. 12
0
 public int CompareTo(Identity <A> other) =>
 default(OrdDefault <A>).Compare(value, other.value);
Esempio n. 13
0
 public bool Equals(Identity <A> other) =>
 default(EqDefault <A>).Equals(value, other.value) && IsBottom == other.IsBottom;
Esempio n. 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);
Esempio n. 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));