import * as tsplus_module_1 from "@effect/core/io/Effect/operations/failNow";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/succeedNow";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/foldEffect";
/**
 * Returns an effect whose failure and success channels have been mapped by
 * the specified pair of functions, `f` and `g`.
 *
 * @tsplus fluent ets/Effect mapBoth
 */

export function mapBoth_(self, f, g, __tsplusTrace) {
  return tsplus_module_3.foldEffect_(self, e => tsplus_module_1.failNow(f(e), __tsplusTrace), a => tsplus_module_2.succeedNow(g(a), __tsplusTrace), __tsplusTrace);
}
/**
 * Returns an effect whose failure and success channels have been mapped by
 * the specified pair of functions, `f` and `g`.
 *
 * @tsplus static ets/Effect/Aspects mapBoth
 */

export const mapBoth = (f, g, __tsplusTrace) => self => mapBoth_(self, f, g, __tsplusTrace);
//# sourceMappingURL=mapBoth.mjs.map