import * as tsplus_module_1 from "@effect/core/io/Cause/operations/squashWith";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/failNow";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/succeedNow";
import * as tsplus_module_4 from "@effect/core/io/Effect/operations/sandbox";
import * as tsplus_module_5 from "@effect/core/io/Effect/operations/foldEffect";
/**
 * Attempts to convert defects into a failure, throwing away all information
 * about the cause of the failure.
 *
 * @tsplus fluent ets/Effect absorbWith
 */

export function absorbWith_(self, f, __tsplusTrace) {
  return tsplus_module_5.foldEffect_(tsplus_module_4.sandbox(self, __tsplusTrace), cause => tsplus_module_2.failNow(tsplus_module_1.squashWith_(cause, f), __tsplusTrace), tsplus_module_3.succeedNow, __tsplusTrace);
}
/**
 * Attempts to convert defects into a failure, throwing away all information
 * about the cause of the failure.
 *
 * @tsplus static ets/Effect/Aspects absorbWith
 */

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