/** * Folds over the failure value or the success value to yield an effect that * does not fail, but succeeds with the value returned by the left or right * function passed to `fold`. * * @tsplus static effect/core/io/Effect.Aspects fold * @tsplus pipeable effect/core/io/Effect fold */ export function fold( failure: (e: E) => A2, success: (a: A) => A3 ) { return (self: Effect): Effect => self.foldEffect( (e) => Effect.succeed(failure(e)), (a) => Effect.succeed(success(a)) ) }