import * as tsplus_module_1 from "@effect/core/stream/Stream/operations/failCause";
import * as tsplus_module_2 from "@effect/core/io/Cause/operations/failureOrCause";
import * as tsplus_module_3 from "@tsplus/stdlib/data/Either/fold";
import * as tsplus_module_4 from "@effect/core/stream/Stream/operations/catchAllCause";
/**
 * Switches over to the stream produced by the provided function in case this
 * one fails with a typed error.
 *
 * @tsplus fluent ets/Stream catchAll
 */

export function catchAll_(self, f, __tsplusTrace) {
  return tsplus_module_4.catchAllCause_(self, cause => tsplus_module_3.fold_(tsplus_module_2.failureOrCause(cause), f, cause => tsplus_module_1.failCause(() => cause, __tsplusTrace)), __tsplusTrace);
}
/**
 * Switches over to the stream produced by the provided function in case this
 * one fails with a typed error.
 *
 * @tsplus static ets/Stream/Aspects catchAll
 */

export const catchAll = (f, __tsplusTrace) => self => catchAll_(self, f, __tsplusTrace);
//# sourceMappingURL=catchAll.mjs.map