"use strict"
Object.defineProperty(exports, "__esModule", { value: true })
exports.mapError = exports.mapError_ = void 0
// tracing: off
const core_1 = require("../Cause/core")
const core_2 = require("./core")
/**
 * Returns an effect with its error channel mapped using the specified
 * function. This can be used to lift a "smaller" error into a "larger"
 * error.
 */
function mapError_(self, f, __trace) {
  return (0, core_2.foldCauseM_)(
    self,
    (c) => (0, core_2.halt)((0, core_1.map_)(c, f)),
    (a) => (0, core_2.succeed)(a),
    __trace
  )
}
exports.mapError_ = mapError_
/**
 * Returns an effect with its error channel mapped using the specified
 * function. This can be used to lift a "smaller" error into a "larger"
 * error.
 *
 * @dataFirst mapError_
 */
function mapError(f, __trace) {
  return (self) => mapError_(self, f, __trace)
}
exports.mapError = mapError
//# sourceMappingURL=mapError.js.map
