import * as tsplus_module_1 from "@effect/core/stream/Stream/operations/failCause";
import * as tsplus_module_2 from "@tsplus/stdlib/data/Maybe/getOrElse";
import * as tsplus_module_3 from "@effect/core/stream/Stream/operations/catchAllCause";
/**
 * Switches over to the stream produced by the provided function in case this
 * one fails with some errors. Allows recovery from all causes of failure,
 * including interruption if the stream is uninterruptible.
 *
 * @tsplus fluent ets/Stream catchSomeCause
 */

export function catchSomeCause_(self, pf, __tsplusTrace) {
  return tsplus_module_3.catchAllCause_(self, cause => tsplus_module_2.getOrElse_(pf(cause), () => tsplus_module_1.failCause(() => cause, __tsplusTrace)), __tsplusTrace);
}
/**
 * Switches over to the stream produced by the provided function in case this
 * one fails with some errors. Allows recovery from all causes of failure,
 * including interruption if the stream is uninterruptible.
 *
 * @tsplus static ets/Stream/Aspects catchSomeCause
 */

export const catchSomeCause = (pf, __tsplusTrace) => self => catchSomeCause_(self, pf, __tsplusTrace);
//# sourceMappingURL=catchSomeCause.mjs.map