// ets_tracing: off import * as O from "../../../../Option/index.js" import type * as C from "../core.js" import * as CatchAll from "./catchAll.js" /** * Switches over to the stream produced by the provided function in case this one * fails with some typed error. */ export function catchSome_( self: C.Stream, pf: (e: E) => O.Option> ): C.Stream { return CatchAll.catchAll_(self, (e) => O.fold_( pf(e), () => fail(e), (_) => _ ) ) } /** * Switches over to the stream produced by the provided function in case this one * fails with some typed error. * * @ets_data_first catchSome_ */ export function catchSome(pf: (e: E) => O.Option>) { return (self: C.Stream) => catchSome_(self, pf) }