@Test public void map(){ ReaderWriterState<String,Integer,String,Integer> rws = ReaderWriterState.rws((r, s)->Tuple.tuple(10,s,1), Monoids.intMax); ReaderWriterState<String, Integer, String, Integer> mapped = rws.map(i -> i * 2); assertThat(mapped.run("hello","world"),equalTo(Tuple.tuple(10, "world", 2))); }
public <R2> ReaderWriterState<R,W,S,R2> map(Function<? super T,? extends R2> mapper) { return mapState(t -> tuple(t._1(), t._2(), mapper.apply(t._3()))); }
ReaderWriterState implements Higher4<rws,R,W,S,T> { public <R2> ReaderWriterState<R,W,S,R2> map(Function<? super T,? extends R2> mapper) { return mapState(t -> tuple(t._1(), t._2(), mapper.apply(t._3()))); } }
ReaderWriterState implements Higher4<rws,R,W,S,T> { public <R2> ReaderWriterState<R,W,S,R2> map(Function<? super T,? extends R2> mapper) { return mapState(t -> tuple(t._1(), t._2(), mapper.apply(t._3()))); }  }
ReaderWriterState implements Higher4<rws,R,W,S,T> { public <R2> ReaderWriterState<R,W,S,R2> map(Function<? super T,? extends R2> mapper) { return mapState(t -> tuple(t._1(), t._2(), mapper.apply(t._3()))); }  Tuple3<W,S,T> run(R r,S s); static ReaderWriterState<R1, W, S, R> tailRec(Monoid<W> monoid,T initial, Function<? super T, ? extends  ReaderWriterState<R1, W, S,  ? extends Either<T, R>>> fn); ReaderWriterState<R,W,S,T> tell(W value); ReaderWriterState<R,W,S,T> ask(); ReaderWriterState<R,W,S,T> local(Function<? super  R,? extends R> fn); ReaderWriterState<R,W,S,R2> map(Function<? super T,? extends R2> mapper); ReaderWriterState<R,W,S,R2> mapState(Function<Tuple3<W,S,T>, Tuple3<W,S, R2>> fn); ReaderWriterState<R,W,S,R2> flatMap(Function<? super T,? extends  ReaderWriterState<R,W,S,R2>> f); ReaderWriterState<R,W,S,R4> forEach4(Function<? super T, ReaderWriterState<R,W,S,R1>> value2,
                                                      BiFunction<? super T, ? super R1, ReaderWriterState<R,W,S,R2>> value3,
                                                      Function3<? super T, ? super R1, ? super R2, ReaderWriterState<R,W,S,R3>> value4,
                                                      Function4<? super T, ? super R1, ? super R2, ? super R3, ? extends R4> yieldingFunction); ReaderWriterState<R,W,S,R4> forEach3(Function<? super T, ReaderWriterState<R,W,S,R1>> value2,
                                                  BiFunction<? super T, ? super R1, ReaderWriterState<R,W,S,R2>> value3,
                                                  Function3<? super T, ? super R1, ? super R2, ? extends R4> yieldingFunction); ReaderWriterState<R,W,S,R4> forEach2(Function<? super T, ReaderWriterState<R,W,S,R1>> value2,
                                              BiFunction<? super T, ? super R1, ? extends R4> yieldingFunction); static ReaderWriterState<R,W,S,T> rws(BiFunction<? super R, ? super S,? extends Tuple3<W,S, T>> runF, Monoid<W> monoid); static ReaderWriterState<R,W,S,T> narrowK(Higher<Higher<Higher<Higher<rws, R>, W>, S>, T> hkt); static Higher<Higher<Higher<Higher<rws, R>, W>, S>, T> widen(ReaderWriterState<R,W,S,T> narrow); }
ReaderWriterState implements Higher4<rws,R,W,S,T> { public <R2> ReaderWriterState<R,W,S,R2> map(Function<? super T,? extends R2> mapper) { return mapState(t -> tuple(t._1(), t._2(), mapper.apply(t._3()))); }  Tuple3<W,S,T> run(R r,S s); static ReaderWriterState<R1, W, S, R> tailRec(Monoid<W> monoid,T initial, Function<? super T, ? extends  ReaderWriterState<R1, W, S,  ? extends Either<T, R>>> fn); ReaderWriterState<R,W,S,T> tell(W value); ReaderWriterState<R,W,S,T> ask(); ReaderWriterState<R,W,S,T> local(Function<? super  R,? extends R> fn); ReaderWriterState<R,W,S,R2> map(Function<? super T,? extends R2> mapper); ReaderWriterState<R,W,S,R2> mapState(Function<Tuple3<W,S,T>, Tuple3<W,S, R2>> fn); ReaderWriterState<R,W,S,R2> flatMap(Function<? super T,? extends  ReaderWriterState<R,W,S,R2>> f); ReaderWriterState<R,W,S,R4> forEach4(Function<? super T, ReaderWriterState<R,W,S,R1>> value2,
                                                      BiFunction<? super T, ? super R1, ReaderWriterState<R,W,S,R2>> value3,
                                                      Function3<? super T, ? super R1, ? super R2, ReaderWriterState<R,W,S,R3>> value4,
                                                      Function4<? super T, ? super R1, ? super R2, ? super R3, ? extends R4> yieldingFunction); ReaderWriterState<R,W,S,R4> forEach3(Function<? super T, ReaderWriterState<R,W,S,R1>> value2,
                                                  BiFunction<? super T, ? super R1, ReaderWriterState<R,W,S,R2>> value3,
                                                  Function3<? super T, ? super R1, ? super R2, ? extends R4> yieldingFunction); ReaderWriterState<R,W,S,R4> forEach2(Function<? super T, ReaderWriterState<R,W,S,R1>> value2,
                                              BiFunction<? super T, ? super R1, ? extends R4> yieldingFunction); static ReaderWriterState<R,W,S,T> rws(BiFunction<? super R, ? super S,? extends Tuple3<W,S, T>> runF, Monoid<W> monoid); static ReaderWriterState<R,W,S,T> narrowK(Higher<Higher<Higher<Higher<rws, R>, W>, S>, T> hkt); static Higher<Higher<Higher<Higher<rws, R>, W>, S>, T> widen(ReaderWriterState<R,W,S,T> narrow);  }