import * as tsplus_module_1 from "@effect/core/stream/Stream/operations/fail";
import * as tsplus_module_2 from "@tsplus/stdlib/data/Maybe/getOrElse";
import * as tsplus_module_3 from "@effect/core/stream/Stream/operations/catchAll";
/**
 * Switches over to the stream produced by the provided function in case this
 * one fails with some typed error.
 *
 * @tsplus fluent ets/Stream catchSome
 */

export function catchSome_(self, pf, __tsplusTrace) {
  return tsplus_module_3.catchAll_(self, e => tsplus_module_2.getOrElse_(pf(e), () => tsplus_module_1.fail(() => e, __tsplusTrace)), __tsplusTrace);
}
/**
 * Switches over to the stream produced by the provided function in case this
 * one fails with some typed error.
 *
 * @tsplus static ets/Stream/Aspects catchSome
 */

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