Beispiel #1
0
 public static Seq <A> New(Lst <A> seq, int index = 0, int count = -1) =>
 seq.Count == 0
         ? Empty
         : new SeqLst <A>(seq, index, count);
Beispiel #2
0
        public static async Task <Lst <B> > Traverse <A, B>(this Lst <Task <A> > ma, Func <A, B> f)
        {
            var rb = await Task.WhenAll(ma.Map(async a => f(await a))).ConfigureAwait(false);

            return(new Lst <B>(rb));
        }
Beispiel #3
0
 public static OptionUnsafe <Lst <B> > Sequence <A, B>(this Lst <A> ta, Func <A, OptionUnsafe <B> > f) =>
 ta.Map(f).Sequence();
Beispiel #4
0
 /// <summary>
 /// Ctor
 /// </summary>
 VectorClock(Lst <ClockEntry> versions)
 {
     Versions = versions;
 }
Beispiel #5
0
 public static Try <Lst <B> > Sequence <A, B>(this Lst <A> ta, Func <A, Try <B> > f) =>
 ta.Map(f).Sequence();
 public static Validation <MonoidFail, Fail, Lst <A> > Sequence <MonoidFail, Fail, A>(this Lst <Validation <MonoidFail, Fail, A> > ta)
     where MonoidFail : struct, Monoid <Fail>, Eq <Fail> =>
 ta.Traverse(identity);
Beispiel #7
0
 public static State <S, Lst <A> > Sequence <S, A>(this Lst <State <S, A> > ma) =>
 SequenceFast(ma).Map(toList);
Beispiel #8
0
 public static Aff <Lst <B> > TraverseParallel <A, B>(this Lst <Aff <A> > ma, Func <A, B> f) =>
 TraverseParallel <A, B>(ma, f, SysInfo.DefaultAsyncSequenceParallelism);
Beispiel #9
0
 public Lst <PredList, PredItem, A> Append(Lst <PredList, PredItem, A> rhs) =>
 new Lst <PredList, PredItem, A>(Value.Append(rhs));
Beispiel #10
0
 public Lst <A> Subtract(Lst <A> rhs) =>
 Wrap(Value.Subtract(rhs.Value));
Beispiel #11
0
 public bool Equals(Lst <A> other) =>
 Value.Equals(other.Value);
Beispiel #12
0
 public Lst <A> Append(Lst <A> rhs) =>
 new Lst <A>(Value.Append(rhs));
Beispiel #13
0
 public static Aff <RT, Lst <B> > SequenceSerial <RT, A, B>(this Lst <A> ta, Func <A, Aff <RT, B> > f)
     where RT : struct, HasCancel <RT> =>
 ta.Map(f).SequenceSerial();
Beispiel #14
0
 public static Aff <RT, Lst <B> > SequenceParallel <RT, A, B>(this Lst <A> ta, Func <A, Aff <RT, B> > f, int windowSize)
     where RT : struct, HasCancel <RT> =>
 ta.Map(f).SequenceParallel(windowSize);
Beispiel #15
0
 public static Aff <Lst <A> > SequenceParallel <A>(this Lst <Aff <A> > ma) =>
 TraverseParallel <A, A>(ma, identity, SysInfo.DefaultAsyncSequenceParallelism);
Beispiel #16
0
 public Lst <PredList, PredItem, A> Subtract(Lst <PredList, PredItem, A> rhs) =>
 Wrap(Value.Subtract(rhs.Value));
Beispiel #17
0
 public static Set <Lst <B> > Traverse <A, B>(this Lst <Set <A> > ma, Func <A, B> f) =>
 toSet(CollT.AllCombinationsOf(ma.Map(xs => xs.ToList()).ToSystemArray(), f)
       .Map(toList));
Beispiel #18
0
 public bool Equals(Lst <PredList, PredItem, A> other) =>
 Value.Equals(other.Value);
Beispiel #19
0
 public static Validation <Fail, Lst <B> > Sequence <Fail, A, B>(this Lst <A> ta, Func <A, Validation <Fail, B> > f) =>
 ta.Map(f).Sequence();
Beispiel #20
0
 public static Aff <Lst <A> > SequenceParallel <A>(this Lst <Aff <A> > ma, int windowSize) =>
 TraverseParallel <A, A>(ma, identity, windowSize);
Beispiel #21
0
 public static State <S, Lst <B> > Traverse <S, A, B>(this Lst <State <S, A> > ma, Func <A, B> f) =>
 TraverseFast(ma, f).Map(toList);
Beispiel #22
0
 public static Aff <Lst <A> > SequenceSerial <A>(this Lst <Aff <A> > ma) =>
 TraverseSerial <A, A>(ma, identity);
Beispiel #23
0
 public static Lst <T> cons <T>(this T head, Lst <T> tail) =>
 tail.Insert(0, head);
Beispiel #24
0
 public static Aff <Lst <B> > SequenceParallel <A, B>(this Lst <A> ta, Func <A, Aff <B> > f) =>
 ta.Map(f).SequenceParallel();
Beispiel #25
0
 /// <summary>
 /// Convert an LanguageExt List (Lst T) into an F# List
 /// </summary>
 public static FSharpList <T> fs <T>(Lst <T> list) =>
 ListModule.OfSeq(list);
Beispiel #26
0
 public static Aff <Lst <B> > SequenceParallel <A, B>(this Lst <A> ta, Func <A, Aff <B> > f, int windowSize) =>
 ta.Map(f).SequenceParallel(windowSize);
Beispiel #27
0
 public static Task <Lst <A> > Sequence <A>(this Lst <Task <A> > ma) =>
 ma.Traverse(identity);
Beispiel #28
0
 public static Aff <Lst <B> > SequenceSerial <A, B>(this Lst <A> ta, Func <A, Aff <B> > f) =>
 ta.Map(f).SequenceSerial();
Beispiel #29
0
 public static Either <L, Lst <A> > Sequence <L, A>(this Lst <Either <L, A> > ta) =>
 ta.Traverse(identity);
Beispiel #30
0
 public int CompareTo(Lst <PredList, PredItem, A> other) =>
 Value.CompareTo(other.Value);