"use strict";

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

/**
 * Folds over the value or cause.
 *
 * @tsplus fluent ets/Exit fold
 */
function fold_(self, failed, completed) {
  switch (self._tag) {
    case "Failure":
      return failed(self.cause);

    case "Success":
      return completed(self.value);
  }
}
/**
 * Folds over the value or cause.
 *
 * @tsplus static ets/Exit/Aspects fold
 */


const fold = (failed, completed) => self => fold_(self, failed, completed);

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