Example #1
0
 public static Pair <TreeForest <A>, TreeForest <B> > Unzip <A, B>(this TreeForest <Pair <A, B> > p)
 {
     return(Pair <TreeForest <A>, TreeForest <B> > .pair(p.Select(a => a._1.Get), p.Select(a => a._2.Get)));
 }
Example #2
0
 public List <Pair <A, B> > Zip <B>(List <B> bs) =>
 ZipWith <B, Pair <A, B> >(bs, a => b => Pair <A, B> .pair(a, b));
Example #3
0
        public static PairAndMonoid <X, B> SelectMany <X, A, B>(this PairAndMonoid <X, A> ps, Func <A, PairAndMonoid <X, B> > f)
        {
            var r = f(ps.b);

            return(new PairAndMonoid <X, B>(Pair <X, B> .pair(ps.M.Op(ps.a, r.a), r.b), ps.M));
        }
Example #4
0
 public static Pair <A, B> And <A, B>(this A a, B b)
 {
     return(Pair <A, B> .pair(a, b));
 }
Example #5
0
 public static Iteratee <E, A> Done(A a, Input <E> i)
 {
     return(new Iteratee <E, A>(Pair <A, Input <E> > .pair(a, i).Left <Pair <A, Input <E> >, Func <Input <E>, Iteratee <E, A> > >()));
 }
Example #6
0
 public static Pair <A, B> And <A, B>(this A a, B b) => Pair <A, B> .pair(a, b);