# catchCauseIf

Recovers a failure cause only when a predicate accepts the complete cause.

## Signatures

```ts
export declare const catchCauseIf: {
    <E, A2, E2, R2>(predicate: (cause: Cause.Cause<E>) => boolean, f: (cause: Cause.Cause<E>) => Fx<A2, E2, R2>): <A, R>(self: Fx<A, E, R>) => Fx<A | A2, E | E2, R | R2>;
    <A, E, R, A2, E2, R2>(self: Fx<A, E, R>, predicate: (cause: Cause.Cause<E>) => boolean, f: (cause: Cause.Cause<E>) => Fx<A2, E2, R2>): Fx<A | A2, E | E2, R | R2>;
};
```

## Why

Cause-level predicates can distinguish defects, interruption, sequential or
parallel cause structure that a typed-error predicate cannot observe.

## Ownership and lifetime

The predicate receives the source cause unchanged. A match starts one lazy
fallback in the same subscription; otherwise the original cause propagates.
The fallback's requirements and errors are added, prior source values stay
delivered, and interrupting the returned Fx interrupts its active run.

## Examples

```ts
import { Cause } from "effect"
import { catchCauseIf } from "@typed/fx/Fx"
import { failCause, succeed } from "@typed/fx/Fx"

const recovered = catchCauseIf(
  failCause(Cause.die("bad decoder")),
  Cause.hasDies,
  () => succeed("reported")
)
```
