예제 #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)));
 }
예제 #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));
예제 #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));
        }
예제 #4
0
 public static Pair <A, B> And <A, B>(this A a, B b)
 {
     return(Pair <A, B> .pair(a, b));
 }
예제 #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> > >()));
 }
예제 #6
0
 public static Pair <A, B> And <A, B>(this A a, B b) => Pair <A, B> .pair(a, b);