# Fx.filterMapLoopCause

Loops over the failure causes of an Fx with an accumulator, potentially transforming or filtering them.
This allows for complex error handling logic that maintains state across failures.

## Signatures

```ts
export declare const filterMapLoopCause: {
    <B, A, C>(seed: B, f: (acc: B, a: Cause.Cause<A>) => readonly [
        Option.Option<Cause.Cause<C>>,
        B
    ]): <E, R>(self: Fx<A, E, R>) => Fx<A, C, R>;
    <A, E, R, B, C>(self: Fx<A, E, R>, seed: B, f: (acc: B, a: Cause.Cause<E>) => readonly [
        Option.Option<Cause.Cause<C>>,
        B
    ]): Fx<A, C, R>;
};
```

## Why

`filterMapLoopCause` transforms, suppresses, or reclassifies successive failure causes with
explicit state. Successful values pass through; each observed cause advances the accumulator and
`None` suppresses forwarding that cause.

## Ownership and lifetime

Failure state is isolated to one run and discarded afterward. The pure callback acquires no
resources; defects and interrupts are visible inside the full `Cause` supplied to it.

## Examples

```ts
import { Cause, Option } from "effect"
import { Fx } from "@typed/fx"

const firstFailureOnly = Fx.fail("offline").pipe(
  Fx.filterMapLoopCause(false, (seen, cause) => [seen ? Option.none() : Option.some(Cause.map(cause, String)), true]),
)
```
