import * as tsplus_module_1 from "@effect/core/stm/STM/operations/fail";
import * as tsplus_module_2 from "@effect/core/stm/STM/operations/zipRight";
import * as tsplus_module_3 from "@effect/core/stm/STM/operations/succeedNow";
import * as tsplus_module_4 from "@effect/core/stm/STM/operations/foldSTM";
/**
 * "Peeks" at the error of the transactional effect.
 *
 * @tsplus fluent ets/STM tapError
 */

export function tapError_(self, f) {
  return tsplus_module_4.foldSTM_(self, e => tsplus_module_2.zipRight_(f(e), () => tsplus_module_1.fail(() => e)), tsplus_module_3.succeedNow);
}
/**
 * "Peeks" at the error of the transactional effect.
 *
 * @tsplus static ets/STM/Aspects tapError
 */

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