"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mapTryCatch = exports.mapTryCatch_ = void 0;
// ets_tracing: off
const core_1 = require("./core");
/**
 * Returns an effect whose success is mapped by the specified side effecting
 * `f` function, translating any thrown exceptions into typed failed effects.
 */
function mapTryCatch_(self, f, onThrow, __trace) {
    return (0, core_1.chain_)(self, (a) => (0, core_1.tryCatch)(() => f(a), onThrow, __trace));
}
exports.mapTryCatch_ = mapTryCatch_;
/**
 * Returns an effect whose success is mapped by the specified side effecting
 * `f` function, translating any thrown exceptions into typed failed effects.
 *
 * @ets_data_first mapTryCatch_
 */
function mapTryCatch(f, onThrow, __trace) {
    return (self) => mapTryCatch_(self, f, onThrow, __trace);
}
exports.mapTryCatch = mapTryCatch;
//# sourceMappingURL=mapTryCatch.js.map