Exemple #1
0
 public Y foldl <Y>(Func <Y, X, Y> f, Y y0, Lst <X> container)
 => Lst.foldl(f, y0, container);
Exemple #2
0
 public Y foldr <Y>(Func <X, Y, Y> f, Y y0, Lst <X> container)
 => Lst.foldr(f, y0, container);
Exemple #3
0
 public Lst <Y> apply(Lst <Func <X, Y> > cf, Lst <X> cx)
 => Lst.apply(cf, cx);
Exemple #4
0
 public static Lst <Y> Select <X, Y>(this Lst <X> list, Func <X, Y> selector)
 => Lst.make(from x in list.Stream() select selector(x));
Exemple #5
0
 public bool neq(Lst <X> l1, Lst <X> l2)
 => not(eq(l1, l2));
Exemple #6
0
 public Lst <X> alt(Lst <X> l1, Lst <X> l2)
 => Lst.concat(l1, l2);
Exemple #7
0
 public bool eq(Lst <X> x1, Lst <X> x2)
 => x1 == x2;
Exemple #8
0
 public Func <Lst <X>, Lst <Y> > fmap(Func <X, Y> f)
 => Lst.Functor <X, Y>().fmap(f);
Exemple #9
0
 public Lst <Y> apply(Lst <Func <X, Y> > lf, Lst <X> lx)
 => Lst.apply(lf, lx);
Exemple #10
0
 public Lst <X> combine(Lst <X> a1, Lst <X> a2)
 => a1 + a2;
Exemple #11
0
 public Lst <Y> bind(Lst <X> list, Func <X, Lst <Y> > f)
 => Lst.bind(list, f);
Exemple #12
0
 public static Lst <X> Where <X>(this Lst <X> list, Func <X, bool> predicate)
 => Lst.make(from x in list.Stream() where predicate(x) select x);
Exemple #13
0
 public static Lst <Z> SelectMany <X, Y, Z>(this Lst <X> list, Func <X, Lst <Y> > lift, Func <X, Y, Z> project)
 => Lst.make(from x in list.Stream()
             from y in lift(x).Stream()
             select project(x, y));
Exemple #14
0
 public Lst <Y> traverse(Func <X, Lst <Y> > f, Lst <X> cx)
 => Lst.traverse(f, cx);
Exemple #15
0
 public Lst <X> pure(X x)
 => Lst.singleton(x);
Exemple #16
0
 public Func <Lst <X>, Lst <Y> > extend(Func <Lst <X>, Y> f)
 => lx => from lxt in Lst.tails(lx)
     where not(lxt.IsEmpty)
 let y = f(lxt)
         select y;
Exemple #17
0
 public Lst <Y> bind(Lst <X> f, Func <X, Lst <Y> > g)
 => Lst.bind(f, g);
Exemple #18
0
 public bool eq(Lst <X> l1, Lst <X> l2)
 => Lst.eq(l1, l2);
Exemple #19
0
 public Lst <X> alt(Lst <X> l1, Lst <X> l2)
 => LstAlt <X> .instance.alt(l1, l2);
Exemple #20
0
 public Func <Lst <X>, Lst <Y> > fmap(Func <X, Y> f)
 => Lst.fmap(f);
Exemple #21
0
 public Func <Lst <X>, Lst <Y> > imap(Func <X, Y> f, Func <Y, X> g)
 => lx => Lst.imap(f, g, lx);
Exemple #22
0
 public Func <Lst <X>, Lst <X> > fmap(Func <X, X> f)
 => Lst.fmap(f);
Exemple #23
0
 public X fold(IMonoid <X> m, Lst <X> container)
 => Foldable <X, Lst <X> > .instance.fold(m, container);
Exemple #24
0
 /// <summary>
 /// Creates a list from a stream
 /// </summary>
 /// <typeparam name="X">The item type</typeparam>
 /// <param name="source">The source stream</param>
 /// <returns></returns>
 public static Lst <X> AsList <X>(this IEnumerable <X> source)
 => Lst.make(source);
Exemple #25
0
 /// <summary>
 /// Constructs a weakly-typed frame, if possible
 /// </summary>
 /// <param name="coltypes">The frame column types</param>
 /// <param name="data">Conforming item arrays</param>
 /// <returns></returns>
 public static Option <IDataFrame> make(Lst <Type> coltypes, Lst <object[]> data)
 => from order in some(coltypes.Count - 1)
 from frameTypeDef in FrameTypeDef(order)
 let frameType                         = frameTypeDef.MakeGenericType(coltypes.AsArray())
                             let frame = Activator.CreateInstance(frameType) as IDataFrameRoot
                                         select frame.Construct(data);