import * as tsplus_module_1 from "@effect/core/io/Effect/operations/dieNow";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/succeedNow";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/foldEffect";
/**
 * Keeps none of the errors, and terminates the fiber with them, using the
 * specified function to convert the `E` into a `Throwable`.
 *
 * @tsplus fluent ets/Effect orDieWith
 */

export function orDieWith_(self, f, __tsplusTrace) {
  return tsplus_module_3.foldEffect_(self, e => tsplus_module_1.dieNow(f(e), __tsplusTrace), tsplus_module_2.succeedNow, __tsplusTrace);
}
/**
 * Keeps none of the errors, and terminates the fiber with them, using the
 * specified function to convert the `E` into a `Throwable`.
 *
 * @tsplus static ets/Effect/Aspects orDieWith
 */

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