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

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

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