"use strict"
Object.defineProperty(exports, "__esModule", { value: true })
exports.foldCause = exports.foldCause_ = void 0
const core_1 = require("./core")
/**
 * A more powerful version of `fold` that allows recovering from any kind of failure except interruptions.
 */
function foldCause_(value, failure, success, __trace) {
  return (0, core_1.foldCauseM_)(
    value,
    (c) => (0, core_1.succeed)(failure(c)),
    (x) => (0, core_1.succeed)(success(x)),
    __trace
  )
}
exports.foldCause_ = foldCause_
/**
 * A more powerful version of `fold` that allows recovering from any kind of failure except interruptions.
 *
 * @dataFirst foldCause_
 */
function foldCause(failure, success, __trace) {
  return (value) => foldCause_(value, failure, success, __trace)
}
exports.foldCause = foldCause
//# sourceMappingURL=foldCause.js.map
