@Test public void map(){ State<String,Integer> state = State.<String,Integer>state(s-> Tuple.tuple(s,10)) .map(i->i*2); assertThat(state.run("hello"),equalTo(Tuple.tuple("hello",20))); }
public <R> State<S, R> map(Function<? super T,? extends R> mapper) { return mapState(t -> Tuple.tuple(t._1(), mapper.apply(t._2()))); }
State implements Higher2<state,S,T> { public <R> State<S, R> map(Function<? super T,? extends R> mapper) { return mapState(t -> Tuple.tuple(t._1(), mapper.apply(t._2()))); } }
State implements Higher2<state,S,T> { public <R> State<S, R> map(Function<? super T,? extends R> mapper) { return mapState(t -> Tuple.tuple(t._1(), mapper.apply(t._2()))); }  }
State implements Higher2<state,S,T> { public <R> State<S, R> map(Function<? super T,? extends R> mapper) { return mapState(t -> Tuple.tuple(t._1(), mapper.apply(t._2()))); }  Tuple2<S, T> run(S s); T eval(S s); static State<S, S> get(); static State<S, Nothing> transition(Function<? super S,? extends S> f); static State<S, T> transition(Function<? super S,? extends S> f, T value); State<S, R> combine(State<S, T2> combine, BiFunction<? super T, ? super T2, ? extends R> combiner); State<S, R> map(Function<? super T,? extends R> mapper); State<S, R> mapState(Function<Tuple2<S,T>, Tuple2<S, R>> fn); State<S, R> flatMap(Function<? super T,? extends  State<S, R>> f); static State<S, T> constant(T constant); State<S,R4> forEach4(Function<? super T, ? extends State<S,R1>> value2,
                                                  BiFunction<? super T, ? super R1, ? extends State<S,R2>> value3,
                                                  Function3<? super T, ? super R1, ? super R2, ? extends State<S,R3>> value4,
                                                  Function4<? super T, ? super R1, ? super R2, ? super R3, ? extends R4> yieldingFunction); State<S,R4> forEach3(Function<? super T, ? extends State<S,R1>> value2,
                                             BiFunction<? super T, ? super R1, ? extends State<S,R2>> value3,
                                             Function3<? super T, ? super R1, ? super R2, ? extends R4> yieldingFunction); State<S,R4> forEach2(Function<? super T, State<S,R1>> value2,
                                         BiFunction<? super T, ? super R1, ? extends R4> yieldingFunction); static State<S, R> tailRec(T initial, Function<? super T, ? extends  State<S,  ? extends Either<T, R>>> fn); static State<S, T> state(Function<? super S,? extends Tuple2<S, T>> runF); static State<S, Nothing> of(S s); static State<S, Nothing> put(S s); static State<S,T> narrowK2(final Higher2<state, S,T> t); static State<S,T> narrowK(final Higher<Higher<state, S>,T> t); static Higher<Higher<state, S>, T> widen(State<S,T> narrow); }
State implements Higher2<state,S,T> { public <R> State<S, R> map(Function<? super T,? extends R> mapper) { return mapState(t -> Tuple.tuple(t._1(), mapper.apply(t._2()))); }  Tuple2<S, T> run(S s); T eval(S s); static State<S, S> get(); static State<S, Nothing> transition(Function<? super S,? extends S> f); static State<S, T> transition(Function<? super S,? extends S> f, T value); State<S, R> combine(State<S, T2> combine, BiFunction<? super T, ? super T2, ? extends R> combiner); State<S, R> map(Function<? super T,? extends R> mapper); State<S, R> mapState(Function<Tuple2<S,T>, Tuple2<S, R>> fn); State<S, R> flatMap(Function<? super T,? extends  State<S, R>> f); static State<S, T> constant(T constant); State<S,R4> forEach4(Function<? super T, ? extends State<S,R1>> value2,
                                                  BiFunction<? super T, ? super R1, ? extends State<S,R2>> value3,
                                                  Function3<? super T, ? super R1, ? super R2, ? extends State<S,R3>> value4,
                                                  Function4<? super T, ? super R1, ? super R2, ? super R3, ? extends R4> yieldingFunction); State<S,R4> forEach3(Function<? super T, ? extends State<S,R1>> value2,
                                             BiFunction<? super T, ? super R1, ? extends State<S,R2>> value3,
                                             Function3<? super T, ? super R1, ? super R2, ? extends R4> yieldingFunction); State<S,R4> forEach2(Function<? super T, State<S,R1>> value2,
                                         BiFunction<? super T, ? super R1, ? extends R4> yieldingFunction); static State<S, R> tailRec(T initial, Function<? super T, ? extends  State<S,  ? extends Either<T, R>>> fn); static State<S, T> state(Function<? super S,? extends Tuple2<S, T>> runF); static State<S, Nothing> of(S s); static State<S, Nothing> put(S s); static State<S,T> narrowK2(final Higher2<state, S,T> t); static State<S,T> narrowK(final Higher<Higher<state, S>,T> t); static Higher<Higher<state, S>, T> widen(State<S,T> narrow);  }