"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.foldEffect = void 0;
exports.foldEffect_ = foldEffect_;

/**
 * Sequentially zips the this result with the specified result or else returns
 * the failed `Cause<E>`.
 *
 * @tsplus fluent ets/Exit foldEffect
 */
function foldEffect_(self, failed, completed, __tsplusTrace) {
  switch (self._tag) {
    case "Failure":
      return failed(self.cause);

    case "Success":
      return completed(self.value);
  }
}
/**
 * Sequentially zips the this result with the specified result or else returns
 * the failed `Cause<E>`.
 *
 * @tsplus static ets/Exit/Aspects foldEffect
 */


const foldEffect = (failed, completed, __tsplusTrace) => self => foldEffect_(self, failed, completed, __tsplusTrace);

exports.foldEffect = foldEffect;
//# sourceMappingURL=foldEffect.js.map