"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mapErrorCause = exports.mapErrorCause_ = void 0;
const core_1 = require("./core");
/**
 * Returns an effect with its full cause of failure mapped using
 * the specified function. This can be used to transform errors
 * while preserving the original structure of Cause.
 */
function mapErrorCause_(self, f, __trace) {
    return (0, core_1.foldCauseM_)(self, (c) => (0, core_1.halt)(f(c)), core_1.succeed, __trace);
}
exports.mapErrorCause_ = mapErrorCause_;
/**
 * Returns an effect with its full cause of failure mapped using
 * the specified function. This can be used to transform errors
 * while preserving the original structure of Cause.
 */
function mapErrorCause(f, __trace) {
    return (self) => (0, core_1.foldCauseM_)(self, (c) => (0, core_1.halt)(f(c)), core_1.succeed, __trace);
}
exports.mapErrorCause = mapErrorCause;
//# sourceMappingURL=mapErrorCause.js.map