import * as tsplus_module_1 from "@effect/core/io/Effect/operations/failCauseNow";
import * as tsplus_module_2 from "@tsplus/stdlib/data/Maybe/fold";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/succeedNow";
import * as tsplus_module_4 from "@effect/core/io/Effect/operations/foldCauseEffect";
/**
 * Recovers from some or all of the error cases with provided cause.
 *
 * @tsplus fluent ets/Effect catchSomeCause
 */

export function catchSomeCause_(self, f, __tsplusTrace) {
  return tsplus_module_4.foldCauseEffect_(self, c => tsplus_module_2.fold_(f(c), () => tsplus_module_1.failCauseNow(c, __tsplusTrace), a => a), tsplus_module_3.succeedNow, __tsplusTrace);
}
/**
 * Recovers from some or all of the error cases with provided cause.
 *
 * @tsplus static ets/Effect/Aspects catchSomeCause
 */

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