@Test public void andThen(@Mock Consumer1<String> console) { Schedule<IO_, Unit, Integer> two = scheduleOfIO.<Unit>recurs(1).andThen(scheduleOfIO.<Unit>recurs(1)); IO<Unit> print = IO.exec(() -> console.accept("hola")); IO<Integer> repeat = monadError.repeat(print, two).fix(toIO()); Integer provide = repeat.unsafeRunSync(); assertEquals(1, provide); verify(console, times(3)).accept("hola"); }
public Schedule<F, A, B> andThen(Schedule<F, A, B> next) { return andThenEither(next).map(Either::merge); }
ScheduleImpl implements SealedSchedule<F, A, B>, Schedule.Update<F, S, A>, Schedule.Extract<A, S, B> { public Schedule<F, A, B> andThen(Schedule<F, A, B> next) { return andThenEither(next).map(Either::merge); } }
ScheduleImpl implements SealedSchedule<F, A, B>, Schedule.Update<F, S, A>, Schedule.Extract<A, S, B> { public Schedule<F, A, B> andThen(Schedule<F, A, B> next) { return andThenEither(next).map(Either::merge); } private  ScheduleImpl(Monad<F> monad, Timer<F> timer); }
ScheduleImpl implements SealedSchedule<F, A, B>, Schedule.Update<F, S, A>, Schedule.Extract<A, S, B> { public Schedule<F, A, B> andThen(Schedule<F, A, B> next) { return andThenEither(next).map(Either::merge); } private  ScheduleImpl(Monad<F> monad, Timer<F> timer); abstract Kind<F, S> initial(); @Override Monad<F> monad(); @Override Timer<F> timer(); @Override Schedule<F, A, C> map(Function1<? super B, ? extends C> mapper); @Override Schedule<F, C, B> contramap(Function1<? super C, ? extends A> comap); Schedule<F, A, B> andThen(Schedule<F, A, B> next); @SuppressWarnings("unchecked") Schedule<F, A, Either<B, C>> andThenEither(Schedule<F, A, C> next); @SuppressWarnings("unchecked") @Override Schedule<F, A, Tuple2<B, C>> zip(Schedule<F, A, C> other); @SuppressWarnings("unchecked") @Override Schedule<F, A, C> compose(Schedule<F, B, C> other); @Override Schedule<F, A, Z> foldM(Z zero, Function2<? super Z, ? super B, ? extends Kind<F, Either<Unit, ? extends Z>>> next); @Override Schedule<F, A, B> addDelayM(Function1<B, Kind<F, Duration>> map); @Override Schedule<F, A, B> untilInputM(Function1<A, Kind<F, Boolean>> condition); @Override Schedule<F, A, B> untilOutputM(Function1<B, Kind<F, Boolean>> condition); @Override Schedule<F, A, B> check(Function2<A, B, Kind<F, Boolean>> condition); static ScheduleImpl<F, S, A, B> of(
      Monad<F> monad,
      Timer<F> timer,
      Kind<F, S> initial, 
      Update<F, S, A> update,
      Extract<A, S, B> extract); }
ScheduleImpl implements SealedSchedule<F, A, B>, Schedule.Update<F, S, A>, Schedule.Extract<A, S, B> { public Schedule<F, A, B> andThen(Schedule<F, A, B> next) { return andThenEither(next).map(Either::merge); } private  ScheduleImpl(Monad<F> monad, Timer<F> timer); abstract Kind<F, S> initial(); @Override Monad<F> monad(); @Override Timer<F> timer(); @Override Schedule<F, A, C> map(Function1<? super B, ? extends C> mapper); @Override Schedule<F, C, B> contramap(Function1<? super C, ? extends A> comap); Schedule<F, A, B> andThen(Schedule<F, A, B> next); @SuppressWarnings("unchecked") Schedule<F, A, Either<B, C>> andThenEither(Schedule<F, A, C> next); @SuppressWarnings("unchecked") @Override Schedule<F, A, Tuple2<B, C>> zip(Schedule<F, A, C> other); @SuppressWarnings("unchecked") @Override Schedule<F, A, C> compose(Schedule<F, B, C> other); @Override Schedule<F, A, Z> foldM(Z zero, Function2<? super Z, ? super B, ? extends Kind<F, Either<Unit, ? extends Z>>> next); @Override Schedule<F, A, B> addDelayM(Function1<B, Kind<F, Duration>> map); @Override Schedule<F, A, B> untilInputM(Function1<A, Kind<F, Boolean>> condition); @Override Schedule<F, A, B> untilOutputM(Function1<B, Kind<F, Boolean>> condition); @Override Schedule<F, A, B> check(Function2<A, B, Kind<F, Boolean>> condition); static ScheduleImpl<F, S, A, B> of(
      Monad<F> monad,
      Timer<F> timer,
      Kind<F, S> initial, 
      Update<F, S, A> update,
      Extract<A, S, B> extract);  }