"use strict";

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

/**
 * Flat maps over the value type.
 *
 * @tsplus fluent ets/Exit flatMap
 */
function flatMap_(self, f) {
  switch (self._tag) {
    case "Failure":
      return self;

    case "Success":
      return f(self.value);
  }
}
/**
 * Flat maps over the value type.
 *
 * @tsplus static ets/Exit/Aspects flatMap
 */


const flatMap = f => self => flatMap_(self, f);

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