"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mapBoth = exports.mapBoth_ = void 0;
// ets_tracing: off
const core_1 = require("./core");
const fail_1 = require("./fail");
const foldM_1 = require("./foldM");
/**
 * Returns an effect whose failure and success channels have been mapped by
 * the specified pair of functions, `f` and `g`.
 */
function mapBoth_(self, f, g, __trace) {
    return (0, foldM_1.foldM_)(self, (e) => (0, fail_1.fail)(f(e)), (a) => (0, core_1.succeed)(g(a)), __trace);
}
exports.mapBoth_ = mapBoth_;
/**
 * Returns an effect whose failure and success channels have been mapped by
 * the specified pair of functions, `f` and `g`.
 *
 * @ets_data_first mapBoth_
 */
function mapBoth(f, g, __trace) {
    return (self) => mapBoth_(self, f, g, __trace);
}
exports.mapBoth = mapBoth;
//# sourceMappingURL=mapBoth.js.map