"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.tapCause_ = exports.tapCause = void 0;
const core_1 = require("./core");
/**
 * Returns an effect that effectually "peeks" at the cause of the failure of
 * this effect.
 *
 * @ets_data_first tapCause_
 */
function tapCause(f, __trace) {
    return (effect) => tapCause_(effect, f, __trace);
}
exports.tapCause = tapCause;
/**
 * Returns an effect that effectually "peeks" at the cause of the failure of
 * this effect.
 */
function tapCause_(effect, f, __trace) {
    return (0, core_1.foldCauseM_)(effect, (c) => (0, core_1.chain_)(f(c), () => (0, core_1.halt)(c)), core_1.succeed, __trace);
}
exports.tapCause_ = tapCause_;
//# sourceMappingURL=tapCause.js.map