import * as tsplus_module_1 from "@effect/core/io/Cause/operations/map";
import * as tsplus_module_2 from "@effect/core/io/Exit/operations/failCause";
/**
 * Maps over the error type.
 *
 * @tsplus fluent ets/Exit mapError
 */

export function mapError_(self, f) {
  switch (self._tag) {
    case "Failure":
      return tsplus_module_2.failCause(tsplus_module_1.map_(self.cause, f));

    case "Success":
      return self;
  }
}
/**
 * Maps over the error type.
 *
 * @tsplus static ets/Exit/Aspects mapError
 */

export const mapError = f => self => mapError_(self, f);
//# sourceMappingURL=mapError.mjs.map