# Fx.filterMapLoop

Loops over an Fx with an accumulator, producing an optional new value for each element.
If the function returns `None`, the element is filtered out.

## Signatures

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

## Why

`filterMapLoop` combines per-run state, mapping, and filtering in one ordered step. Every input
updates the accumulator and may emit one `Some`; `None` still commits the returned next state.

## Ownership and lifetime

The seed is copied into each run and retained only until that run ends. The callback is pure, and
source failure, services, completion, and interruption are preserved.

## Examples

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

const everyOther = Fx.fromIterable([1, 2, 3]).pipe(
  Fx.filterMapLoop(0, (index, value) => [index % 2 === 0 ? Option.some(value) : Option.none(), index + 1]),
)
```
