import * as tsplus_module_1 from "@effect/core/stm/STM/operations/tryCatch";
import * as tsplus_module_2 from "@effect/core/stm/STM/operations/flatMap";
/**
 * Returns an effect whose success is mapped by the specified side effecting
 * `f` function, translating any thrown exceptions into typed failed effects.
 *
 * @tsplus fluent ets/STM mapTryCatch
 */

export function mapTryCatch_(self, f, onThrow) {
  return tsplus_module_2.flatMap_(self, a => tsplus_module_1.tryCatch(() => f(a), onThrow));
}
/**
 * Returns an effect whose success is mapped by the specified side effecting
 * `f` function, translating any thrown exceptions into typed failed effects.
 *
 * @tsplus static ets/STM/Aspects mapTryCatch
 */

export const mapTryCatch = (f, onThrow) => self => mapTryCatch_(self, f, onThrow);
//# sourceMappingURL=mapTryCatch.mjs.map