public PairAndMonoid <A, Pair <B, C> > Zip <C>(PairAndMonoid <A, C> o) { return(ZipWith <C, Pair <B, C> >(o, Pair <B, C> .pairF())); }
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)); }
public PairAndSemigroup <A, Pair <B, C> > Zip <C>(PairAndSemigroup <A, C> o) { return(ZipWith <C, Pair <B, C> >(o, Pair <B, C> .pairF())); }
internal PairAndMonoid(Pair <A, B> pair, Monoid <A> m) { this.pair = pair; this.m = m; }
internal PairAndSemigroup(Pair <A, B> pair, Semigroup <A> s) { this.pair = pair; this.s = s; }
public static Pair <A, B> And <A, B>(this A a, B b) { return(Pair <A, B> .pair(a, b)); }
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))); }
public List <Pair <A, B> > Product <B>(List <B> o) { return(ZipWith <B, Pair <A, B> >(o, Pair <A, B> .pairF())); }
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))); }