/** * Applies the function `f` to the successful result of the `Exit` and returns * the result in a new `Exit`. * * @tsplus static effect/core/io/Exit.Aspects forEach * @tsplus pipeable effect/core/io/Exit forEach */ export function forEach( f: (a: A) => Effect ) { return (self: Exit): Effect> => { switch (self._tag) { case "Failure": return Effect.succeed(Exit.failCause(self.cause)) case "Success": return f(self.value).exit } } }