// ets_tracing: off import * as O from "../Option/index.js" import { catchSomeDefect_ } from "./catchSomeDefect.js" import type { Effect } from "./effect.js" /** * Recovers from all defects with provided function. * * '''WARNING''': There is no sensible way to recover from defects. This * method should be used only at the boundary between Effect and an external * system, to transmit information on a defect for diagnostic or explanatory * purposes. */ export function catchAllDefect_( fa: Effect, f: (_: unknown) => Effect, __trace?: string ) { return catchSomeDefect_(fa, (u) => O.some(f(u)), __trace) } /** * Recovers from all defects with provided function. * * '''WARNING''': There is no sensible way to recover from defects. This * method should be used only at the boundary between Effect and an external * system, to transmit information on a defect for diagnostic or explanatory * purposes. * * @ets_data_first catchAllDefect_ */ export function catchAllDefect( f: (_: unknown) => Effect, __trace?: string ) { return (effect: Effect) => catchAllDefect_(effect, f, __trace) }