Exemplo n.º 1
0
 public static Validation <Fail, Arr <B> > Sequence <Fail, A, B>(this Arr <A> ta, Func <A, Validation <Fail, B> > f) =>
 ta.Map(f).Sequence();
Exemplo n.º 2
0
 public static Arr <Arr <B> > Traverse <A, B>(this Arr <Arr <A> > xxs, Func <A, B> f) =>
 CollT.AllCombinationsOf(xxs.Map(xs => xs.ToList()).ToArray(), f)
 .Map(toArray)
 .ToArr();
Exemplo n.º 3
0
 public static Writer <MonoidW, W, Arr <A> > Sequence <MonoidW, W, A>(this Arr <Writer <MonoidW, W, A> > ma) where MonoidW : struct, Monoid <W> =>
 SequenceFast(ma).Map(toArray);
 public static Seq <A> Cons <A>(this A head, Arr <A> tail) =>
 Cons(head, tail.Value);
Exemplo n.º 5
0
 public bool Equals(Arr <A> other) =>
 default(MArr <A>).Equals(this, other);
Exemplo n.º 6
0
 public static Arr <T> remove <T>(Arr <T> array, T value) =>
 array.Remove(value);
Exemplo n.º 7
0
 public static Arr <T> rev <T>(Arr <T> array) =>
 array.Reverse();
Exemplo n.º 8
0
 public static HashSet <Arr <A> > Sequence <A>(this Arr <HashSet <A> > ta) =>
 ta.Traverse(identity);
Exemplo n.º 9
0
 public static RWS <MonoidW, R, W, S, Arr <A> > Sequence <MonoidW, R, W, S, A>(this Arr <RWS <MonoidW, R, W, S, A> > ma) where MonoidW : struct, Monoid <W> =>
 SequenceFast(ma).Map(toArray);
Exemplo n.º 10
0
 public static OptionUnsafe <Arr <B> > Sequence <A, B>(this Arr <A> ta, Func <A, OptionUnsafe <B> > f) =>
 ta.Map(f).Sequence();
Exemplo n.º 11
0
 public static Either <L, Arr <A> > Sequence <L, A>(this Arr <Either <L, A> > ta) =>
 ta.Traverse(identity);
Exemplo n.º 12
0
        public static async Task <Arr <B> > Traverse <A, B>(this Arr <Task <A> > ma, Func <A, B> f)
        {
            var rb = await Task.WhenAll(ma.Map(async a => f(await a))).ConfigureAwait(false);

            return(new Arr <B>(rb));
        }
Exemplo n.º 13
0
 public static State <S, Arr <B> > Traverse <S, A, B>(this Arr <State <S, A> > ma, Func <A, B> f) =>
 TraverseFast(ma, f).Map(toArray);
Exemplo n.º 14
0
 public static State <S, Arr <A> > Sequence <S, A>(this Arr <State <S, A> > ma) =>
 SequenceFast(ma).Map(toArray);
Exemplo n.º 15
0
 public static Arr <T> add <T>(Arr <T> array, T value) =>
 array.Add(value);
Exemplo n.º 16
0
 public static bool equals <EQ, A>(Arr <A> x, Arr <A> y) where EQ : struct, Eq <A> =>
 EqArr <EQ, A> .Inst.Equals(x, y);
Exemplo n.º 17
0
 public static Arr <T> addRange <T>(Arr <T> array, IEnumerable <T> value) =>
 array.AddRange(value);
Exemplo n.º 18
0
 public static Either <L, Arr <B> > Sequence <L, A, B>(this Arr <A> ta, Func <A, Either <L, B> > f) =>
 ta.Map(f).Sequence();
Exemplo n.º 19
0
 public static Arr <T> removeAt <T>(Arr <T> array, int index) =>
 array.RemoveAt(index);
Exemplo n.º 20
0
 public static Aff <Arr <B> > TraverseParallel <A, B>(this Arr <Aff <A> > ma, Func <A, B> f) =>
 TraverseParallel <A, B>(ma, f, SysInfo.DefaultAsyncSequenceParallelism);
Exemplo n.º 21
0
 public static Seq <A> Cons <A>(this A head, Arr <A> tail) =>
 SeqCons <A> .New(head, SeqArray <A> .New(tail.Value));
Exemplo n.º 22
0
 public static Stck <Arr <A> > Sequence <A>(this Arr <Stck <A> > ta) =>
 ta.Traverse(identity);
Exemplo n.º 23
0
 public Arr <A> Append(Arr <A> rhs) =>
 rhs.InsertRange(0, this);
Exemplo n.º 24
0
 public static Try <Arr <B> > Sequence <A, B>(this Arr <A> ta, Func <A, Try <B> > f) =>
 ta.Map(f).Sequence();
Exemplo n.º 25
0
 public int CompareTo(Arr <A> other) =>
 default(MArr <A>).Compare(this, other);
Exemplo n.º 26
0
 public static IEnumerable <Arr <B> > Sequence <A, B>(this Arr <A> ta, Func <A, IEnumerable <B> > f) =>
 ta.Map(f).Sequence();
Exemplo n.º 27
0
 public static TryOptionAsync <Arr <A> > Sequence <A>(this Arr <TryOptionAsync <A> > ta) =>
 ta.Traverse(identity);
Exemplo n.º 28
0
 public static Aff <RT, Arr <B> > TraverseParallel <RT, A, B>(this Arr <Aff <RT, A> > ma, Func <A, B> f)
     where RT : struct, HasCancel <RT> =>
 TraverseParallel <RT, A, B>(ma, f, SysInfo.DefaultAsyncSequenceParallelism);
Exemplo n.º 29
0
 public static Writer <MonoidW, W, Arr <B> > Traverse <MonoidW, W, A, B>(this Arr <Writer <MonoidW, W, A> > ma, Func <A, B> f) where MonoidW : struct, Monoid <W> =>
 TraverseFast(ma, f).Map(toArray);
Exemplo n.º 30
0
 public static Validation <MonoidFail, Fail, Arr <A> > Sequence <MonoidFail, Fail, A>(this Arr <Validation <MonoidFail, Fail, A> > ta)
     where MonoidFail : struct, Monoid <Fail>, Eq <Fail> =>
 ta.Traverse(identity);