import * as tsplus_module_1 from "@effect/core/stm/STM/operations/fail";
import * as tsplus_module_2 from "@tsplus/stdlib/data/Function";
import * as tsplus_module_3 from "@tsplus/stdlib/data/Maybe/fold";
import * as tsplus_module_4 from "@effect/core/stm/STM/operations/catchAll";
/**
 * Recovers from some or all of the error cases.
 *
 * @tsplus fluent ets/STM catchSome
 */

export function catchSome_(self, f) {
  return tsplus_module_4.catchAll_(self, e => tsplus_module_3.fold_(f(e), () => tsplus_module_1.fail(() => e), tsplus_module_2.identity));
}
/**
 * Recovers from some or all of the error cases.
 *
 * @tsplus static ets/STM/Aspects catchSome
 */

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