# Sink.filterMapLoopCause

Threads pure state through failures and optionally forwards a transformed cause.

## 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>(sink: Sink<A, C, R>) => Sink<A, E, R>;
    <A, E, R, B, C>(sink: Sink<A, C, R>, seed: B, f: (acc: B, a: Cause.Cause<E>) => readonly [
        Option.Option<Cause.Cause<C>>,
        B
    ]): Sink<A, E, R>;
};
```

## Why

Stateful failure suppression and translation can be expressed without discarding Cause structure.

## Ownership and lifetime

Each adapted sink owns its seed. Failure callbacks update state synchronously in invocation order;
`Some` forwards once and `None` suppresses the failure. Successes pass through unchanged. Reusing
the sink continues from its retained seed; create a new sink to reset.

## Examples

```ts
import { Cause, Effect, Option } from "effect"
import * as Sink from "@typed/fx/Sink"
const target: Sink.Sink<number, string> = Sink.make(Effect.logError, Effect.log)
const first = Sink.filterMapLoopCause(target, true, (keep, cause: Cause.Cause<string>) => [keep ? Option.some(cause) : Option.none(), false])
```
