예제 #1
0
 public PairAndMonoid <A, Pair <B, C> > Zip <C>(PairAndMonoid <A, C> o)
 {
     return(ZipWith <C, Pair <B, C> >(o, Pair <B, C> .pairF()));
 }
예제 #2
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));
        }
예제 #3
0
 public PairAndSemigroup <A, Pair <B, C> > Zip <C>(PairAndSemigroup <A, C> o)
 {
     return(ZipWith <C, Pair <B, C> >(o, Pair <B, C> .pairF()));
 }
예제 #4
0
 internal PairAndMonoid(Pair <A, B> pair, Monoid <A> m)
 {
     this.pair = pair;
     this.m    = m;
 }
예제 #5
0
 internal PairAndSemigroup(Pair <A, B> pair, Semigroup <A> s)
 {
     this.pair = pair;
     this.s    = s;
 }
예제 #6
0
 public static Pair <A, B> And <A, B>(this A a, B b)
 {
     return(Pair <A, B> .pair(a, b));
 }
예제 #7
0
 public static Pair <X, B> Select <X, A, B>(this Pair <X, A> ps, Func <A, B> f)
 {
     return(ps._1.Get.And(f(ps._2.Get)));
 }
예제 #8
0
파일: List.cs 프로젝트: dainkaplan/xsharpx
 public List <Pair <A, B> > Product <B>(List <B> o)
 {
     return(ZipWith <B, Pair <A, B> >(o, Pair <A, B> .pairF()));
 }
예제 #9
0
파일: List.cs 프로젝트: dainkaplan/xsharpx
 public List <Pair <A, B> > Zip <B>(List <B> bs)
 {
     return(ZipWith <B, Pair <A, B> >(bs, a => b => Pair <A, B> .pair(a, b)));
 }