@Test public void lazyMap() throws Exception { assertThat(tuple.lazyMapAll(i->i+1, i->i+1,i->i+1,i->i+1),equalTo(Tuple.tuple(3,6,11,11))); tuple.lazyMapAll(i->{ called++; return i+1; },i->i,i->i+1,i->i); assertThat(called,equalTo(0)); }
public <R1,R2,R3,R4> Tuple4<R1,R2,R3,R4> lazyMapAll(Function<? super T1, ? extends R1> fn1, Function<? super T2,? extends R2> fn2, Function<? super T3,? extends R3> fn3, Function<? super T4,? extends R4> fn4){ return lazy(()->(fn1.apply(_1())),()->fn2.apply(_2()),()->fn3.apply(_3()),()->fn4.apply(_4())); }
Tuple4 implements To<Tuple4<T1,T2,T3,T4>>,
                                        Serializable,
                                        Higher4<tuple4,T1,T2,T3,T4>,
                                        EqualTo<Higher<Higher<Higher<tuple4,T1>,T2>,T3>,T4,Tuple4<T1,T2,T3,T4>>,
                                        OrderedBy<Higher<Higher<Higher<tuple4,T1>,T2>,T3>,T4,Tuple4<T1,T2,T3,T4>>,
                                        Comparable<Tuple4<T1,T2,T3,T4>> { public <R1,R2,R3,R4> Tuple4<R1,R2,R3,R4> lazyMapAll(Function<? super T1, ? extends R1> fn1, Function<? super T2,? extends R2> fn2, Function<? super T3,? extends R3> fn3, Function<? super T4,? extends R4> fn4){ return lazy(()->(fn1.apply(_1())),()->fn2.apply(_2()),()->fn3.apply(_3()),()->fn4.apply(_4())); } }
Tuple4 implements To<Tuple4<T1,T2,T3,T4>>,
                                        Serializable,
                                        Higher4<tuple4,T1,T2,T3,T4>,
                                        EqualTo<Higher<Higher<Higher<tuple4,T1>,T2>,T3>,T4,Tuple4<T1,T2,T3,T4>>,
                                        OrderedBy<Higher<Higher<Higher<tuple4,T1>,T2>,T3>,T4,Tuple4<T1,T2,T3,T4>>,
                                        Comparable<Tuple4<T1,T2,T3,T4>> { public <R1,R2,R3,R4> Tuple4<R1,R2,R3,R4> lazyMapAll(Function<? super T1, ? extends R1> fn1, Function<? super T2,? extends R2> fn2, Function<? super T3,? extends R3> fn3, Function<? super T4,? extends R4> fn4){ return lazy(()->(fn1.apply(_1())),()->fn2.apply(_2()),()->fn3.apply(_3()),()->fn4.apply(_4())); }  }
Tuple4 implements To<Tuple4<T1,T2,T3,T4>>,
                                        Serializable,
                                        Higher4<tuple4,T1,T2,T3,T4>,
                                        EqualTo<Higher<Higher<Higher<tuple4,T1>,T2>,T3>,T4,Tuple4<T1,T2,T3,T4>>,
                                        OrderedBy<Higher<Higher<Higher<tuple4,T1>,T2>,T3>,T4,Tuple4<T1,T2,T3,T4>>,
                                        Comparable<Tuple4<T1,T2,T3,T4>> { public <R1,R2,R3,R4> Tuple4<R1,R2,R3,R4> lazyMapAll(Function<? super T1, ? extends R1> fn1, Function<? super T2,? extends R2> fn2, Function<? super T3,? extends R3> fn3, Function<? super T4,? extends R4> fn4){ return lazy(()->(fn1.apply(_1())),()->fn2.apply(_2()),()->fn3.apply(_3()),()->fn4.apply(_4())); }  static Tuple4<T1,T2,T3,T4> of(T1 value1, T2 value2, T3 value3, T4 value4); static Tuple4<T1,T2,T3,T4> lazy(Supplier<? extends T1> supplier1,
                                                         Supplier<? extends T2> supplier2,
                                                         Supplier<? extends T3> supplier3,
                                                         Supplier<? extends T4> supplier4); T1 _1(); T2 _2(); T3 _3(); T4 _4(); Tuple1<T1> first(); Tuple1<T2> second(); Tuple1<T3> third(); Tuple1<T4> fourth(); Tuple4<T1,T2,T3,T4> eager(); R1 transform(Function4<? super T1, ? super T2, ? super T3,? super T4, ? extends R1> fn); Tuple4<T1,T2,T3,T4> memo(); Tuple4<T1,T2,T3,R> flatMap(Monoid<T1> m1, Monoid<T2> m2,Monoid<T3> m3, Function<? super T4, ? extends Tuple4<T1,T2,T3,R>> fn); Tuple4<R1,R2,R3,R4> mapAll(Function<? super T1, ? extends R1> fn1, Function<? super T2,? extends R2> fn2,
                                              Function<? super T3,? extends R3> fn3,
                                                     Function<? super T4,? extends R4> fn4); Tuple4<R1,R2,R3,R4> lazyMapAll(Function<? super T1, ? extends R1> fn1, Function<? super T2,? extends R2> fn2,
                                                  Function<? super T3,? extends R3> fn3,
                                                        Function<? super T4,? extends R4> fn4); Tuple4<R, T2,T3,T4> map1(Function<? super T1, ? extends R> fn); Tuple4<R, T2,T3,T4> lazyMap1(Function<? super T1, ? extends R> fn); Tuple4<T1, R, T3, T4> map2(Function<? super T2, ? extends R> fn); Tuple4<T1, R, T3,T4> lazyMap2(Function<? super T2, ? extends R> fn); Tuple4<T1, T2, R,T4> map3(Function<? super T3, ? extends R> fn); Tuple4<T1, T2, R,T4> lazyMap3(Function<? super T3, ? extends R> fn); Tuple4<T1, T2, T3, R> map4(Function<? super T4, ? extends R> fn); Tuple4<T1, T2, T3, R> lazyMap4(Function<? super T4, ? extends R> fn); R fold(Function4<? super T1, ? super T2, ? super T3,? super T4, ? extends R> fn); @Override String toString(); static Tuple4<T1,T2,T3,T4> narrowK3(Higher4<tuple4,T1,T2,T3,T4> ds); static Tuple4<T1,T2,T3,T4> narrowK(Higher<Higher<Higher<Higher<tuple4,T1>,T2>,T3>,T4> ds); @Override boolean equals(Object o); @Override int hashCode(); @Override int compareTo(Tuple4<T1, T2, T3, T4> o); final Object[] toArray(); Tuple5<T1, T2, T3, T4, T5> concat(Tuple1<T5> tuple); Tuple6<T1, T2, T3, T4, T5, T6> concat(Tuple2<T5,T6> tuple); Tuple7<T1, T2, T3, T4, T5, T6, T7> concat(Tuple3<T5, T6, T7> tuple); Tuple8<T1, T2, T3, T4, T5, T6, T7, T8> concat(Tuple4<T5, T6, T7, T8> tuple); Tuple5<T1, T2, T3, T4, T5> lazyConcat(Tuple1<T5> tuple); Tuple6<T1, T2, T3, T4, T5, T6> lazyConcat(Tuple2<T5,T6> tuple); Tuple7<T1, T2, T3, T4, T5, T6, T7> lazyConcat(Tuple3<T5, T6, T7> tuple); Tuple8<T1, T2, T3, T4, T5, T6, T7, T8> lazyConcat(Tuple4<T5, T6, T7, T8> tuple); }
Tuple4 implements To<Tuple4<T1,T2,T3,T4>>,
                                        Serializable,
                                        Higher4<tuple4,T1,T2,T3,T4>,
                                        EqualTo<Higher<Higher<Higher<tuple4,T1>,T2>,T3>,T4,Tuple4<T1,T2,T3,T4>>,
                                        OrderedBy<Higher<Higher<Higher<tuple4,T1>,T2>,T3>,T4,Tuple4<T1,T2,T3,T4>>,
                                        Comparable<Tuple4<T1,T2,T3,T4>> { public <R1,R2,R3,R4> Tuple4<R1,R2,R3,R4> lazyMapAll(Function<? super T1, ? extends R1> fn1, Function<? super T2,? extends R2> fn2, Function<? super T3,? extends R3> fn3, Function<? super T4,? extends R4> fn4){ return lazy(()->(fn1.apply(_1())),()->fn2.apply(_2()),()->fn3.apply(_3()),()->fn4.apply(_4())); }  static Tuple4<T1,T2,T3,T4> of(T1 value1, T2 value2, T3 value3, T4 value4); static Tuple4<T1,T2,T3,T4> lazy(Supplier<? extends T1> supplier1,
                                                         Supplier<? extends T2> supplier2,
                                                         Supplier<? extends T3> supplier3,
                                                         Supplier<? extends T4> supplier4); T1 _1(); T2 _2(); T3 _3(); T4 _4(); Tuple1<T1> first(); Tuple1<T2> second(); Tuple1<T3> third(); Tuple1<T4> fourth(); Tuple4<T1,T2,T3,T4> eager(); R1 transform(Function4<? super T1, ? super T2, ? super T3,? super T4, ? extends R1> fn); Tuple4<T1,T2,T3,T4> memo(); Tuple4<T1,T2,T3,R> flatMap(Monoid<T1> m1, Monoid<T2> m2,Monoid<T3> m3, Function<? super T4, ? extends Tuple4<T1,T2,T3,R>> fn); Tuple4<R1,R2,R3,R4> mapAll(Function<? super T1, ? extends R1> fn1, Function<? super T2,? extends R2> fn2,
                                              Function<? super T3,? extends R3> fn3,
                                                     Function<? super T4,? extends R4> fn4); Tuple4<R1,R2,R3,R4> lazyMapAll(Function<? super T1, ? extends R1> fn1, Function<? super T2,? extends R2> fn2,
                                                  Function<? super T3,? extends R3> fn3,
                                                        Function<? super T4,? extends R4> fn4); Tuple4<R, T2,T3,T4> map1(Function<? super T1, ? extends R> fn); Tuple4<R, T2,T3,T4> lazyMap1(Function<? super T1, ? extends R> fn); Tuple4<T1, R, T3, T4> map2(Function<? super T2, ? extends R> fn); Tuple4<T1, R, T3,T4> lazyMap2(Function<? super T2, ? extends R> fn); Tuple4<T1, T2, R,T4> map3(Function<? super T3, ? extends R> fn); Tuple4<T1, T2, R,T4> lazyMap3(Function<? super T3, ? extends R> fn); Tuple4<T1, T2, T3, R> map4(Function<? super T4, ? extends R> fn); Tuple4<T1, T2, T3, R> lazyMap4(Function<? super T4, ? extends R> fn); R fold(Function4<? super T1, ? super T2, ? super T3,? super T4, ? extends R> fn); @Override String toString(); static Tuple4<T1,T2,T3,T4> narrowK3(Higher4<tuple4,T1,T2,T3,T4> ds); static Tuple4<T1,T2,T3,T4> narrowK(Higher<Higher<Higher<Higher<tuple4,T1>,T2>,T3>,T4> ds); @Override boolean equals(Object o); @Override int hashCode(); @Override int compareTo(Tuple4<T1, T2, T3, T4> o); final Object[] toArray(); Tuple5<T1, T2, T3, T4, T5> concat(Tuple1<T5> tuple); Tuple6<T1, T2, T3, T4, T5, T6> concat(Tuple2<T5,T6> tuple); Tuple7<T1, T2, T3, T4, T5, T6, T7> concat(Tuple3<T5, T6, T7> tuple); Tuple8<T1, T2, T3, T4, T5, T6, T7, T8> concat(Tuple4<T5, T6, T7, T8> tuple); Tuple5<T1, T2, T3, T4, T5> lazyConcat(Tuple1<T5> tuple); Tuple6<T1, T2, T3, T4, T5, T6> lazyConcat(Tuple2<T5,T6> tuple); Tuple7<T1, T2, T3, T4, T5, T6, T7> lazyConcat(Tuple3<T5, T6, T7> tuple); Tuple8<T1, T2, T3, T4, T5, T6, T7, T8> lazyConcat(Tuple4<T5, T6, T7, T8> tuple);  }