import { makeWithState } from "@effect/core/io/Schedule/operations/_internal/makeWithState" /** * Returns a new schedule that maps the output of this schedule through the * specified effectful function. * * @tsplus static effect/core/io/Schedule.Aspects mapEffect * @tsplus pipeable effect/core/io/Schedule mapEffect */ export function mapEffect( f: (out: Out) => Effect ) { return ( self: Schedule ): Schedule => makeWithState(self.initial, (now, input, state) => self .step(now, input, state) .flatMap(([state, out, decision]) => f(out).map((out2) => [state, out2, decision]))) }