Пример #1
0
 public static bool equals <EQ, A>(Que <A> x, Que <A> y) where EQ : struct, Eq <A> =>
 EqQue <EQ, A> .Inst.Equals(x, y);
Пример #2
0
 public static Aff <RT, Que <A> > SequenceParallel <RT, A>(this Que <Aff <RT, A> > ta, int windowSize)
     where RT : struct, HasCancel <RT> =>
 TraverseParallel(ta, identity, windowSize);
Пример #3
0
 public static Aff <RT, Que <A> > SequenceSerial <RT, A>(this Que <Aff <RT, A> > ta)
     where RT : struct, HasCancel <RT> =>
 TraverseSerial(ta, identity);
Пример #4
0
 public static IEnumerable <Que <B> > Traverse <A, B>(this Que <IEnumerable <A> > ma, Func <A, B> f) =>
 CollT.AllCombinationsOf(ma.Map(xs => xs.ToList()).ToArray(), f)
 .Map(toQueue);
Пример #5
0
 public static Aff <RT, Que <A> > SequenceParallel <RT, A>(this Que <Aff <RT, A> > ta)
     where RT : struct, HasCancel <RT> =>
 TraverseParallel(ta, identity, SysInfo.DefaultAsyncSequenceParallelism);
Пример #6
0
 public static Que <T> enq <T>(Que <T> queue, T value) =>
 queue.Enqueue(value);
Пример #7
0
        public static async Task <Que <B> > Traverse <A, B>(this Que <Task <A> > ma, Func <A, B> f)
        {
            var rb = await Task.WhenAll(ma.Map(async a => f(await a))).ConfigureAwait(false);

            return(new Que <B>(rb));
        }
Пример #8
0
 public static int hash <A>(Que <A> xs) =>
 xs.GetHashCode();
Пример #9
0
 public static HashSet <Que <B> > Traverse <A, B>(this Que <HashSet <A> > ma, Func <A, B> f) =>
 toHashSet(CollT.AllCombinationsOf(ma.Map(xs => xs.ToList()).ToArray(), f)
           .Map(toQueue));
Пример #10
0
 public static Aff <RT, Que <B> > TraverseParallel <RT, A, B>(this Que <Aff <RT, A> > ma, Func <A, B> f)
     where RT : struct, HasCancel <RT> =>
 TraverseParallel <RT, A, B>(ma, f, SysInfo.DefaultAsyncSequenceParallelism);