import * as tsplus_module_1 from "@effect/core/io/Exit/operations/failCause";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/succeed";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/exit";
/**
 * Applies the function `f` to the successful result of the `Exit` and returns
 * the result in a new `Exit`.
 *
 * @tsplus fluent ets/Exit forEach
 */

export function forEach_(self, f, __tsplusTrace) {
  switch (self._tag) {
    case "Failure":
      return tsplus_module_2.succeed(() => tsplus_module_1.failCause(self.cause), __tsplusTrace);

    case "Success":
      return tsplus_module_3.exit(f(self.value), __tsplusTrace);
  }
}
/**
 * Applies the function `f` to the successful result of the `Exit` and returns
 * the result in a new `Exit`.
 *
 * @tsplus static ets/Exit/Aspects forEach
 */

export const forEach = (f, __tsplusTrace) => self => forEach_(self, f, __tsplusTrace);
//# sourceMappingURL=forEach.mjs.map