Example #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();
Example #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();
Example #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);
Example #5
0
 public bool Equals(Arr <A> other) =>
 default(MArr <A>).Equals(this, other);
Example #6
0
 public static Arr <T> remove <T>(Arr <T> array, T value) =>
 array.Remove(value);
Example #7
0
 public static Arr <T> rev <T>(Arr <T> array) =>
 array.Reverse();
Example #8
0
 public static HashSet <Arr <A> > Sequence <A>(this Arr <HashSet <A> > ta) =>
 ta.Traverse(identity);
Example #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);
Example #10
0
 public static OptionUnsafe <Arr <B> > Sequence <A, B>(this Arr <A> ta, Func <A, OptionUnsafe <B> > f) =>
 ta.Map(f).Sequence();
Example #11
0
 public static Either <L, Arr <A> > Sequence <L, A>(this Arr <Either <L, A> > ta) =>
 ta.Traverse(identity);
Example #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));
        }
Example #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);
Example #14
0
 public static State <S, Arr <A> > Sequence <S, A>(this Arr <State <S, A> > ma) =>
 SequenceFast(ma).Map(toArray);
Example #15
0
 public static Arr <T> add <T>(Arr <T> array, T value) =>
 array.Add(value);
Example #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);
Example #17
0
 public static Arr <T> addRange <T>(Arr <T> array, IEnumerable <T> value) =>
 array.AddRange(value);
Example #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();
Example #19
0
 public static Arr <T> removeAt <T>(Arr <T> array, int index) =>
 array.RemoveAt(index);
Example #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);
 public static Seq <A> Cons <A>(this A head, Arr <A> tail) =>
 SeqCons <A> .New(head, SeqArray <A> .New(tail.Value));
Example #22
0
 public static Stck <Arr <A> > Sequence <A>(this Arr <Stck <A> > ta) =>
 ta.Traverse(identity);
Example #23
0
 public Arr <A> Append(Arr <A> rhs) =>
 rhs.InsertRange(0, this);
Example #24
0
 public static Try <Arr <B> > Sequence <A, B>(this Arr <A> ta, Func <A, Try <B> > f) =>
 ta.Map(f).Sequence();
Example #25
0
 public int CompareTo(Arr <A> other) =>
 default(MArr <A>).Compare(this, other);
Example #26
0
 public static IEnumerable <Arr <B> > Sequence <A, B>(this Arr <A> ta, Func <A, IEnumerable <B> > f) =>
 ta.Map(f).Sequence();
 public static TryOptionAsync <Arr <A> > Sequence <A>(this Arr <TryOptionAsync <A> > ta) =>
 ta.Traverse(identity);
Example #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);
Example #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);
Example #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);