# filterEffect

Runs an effectful predicate and forwards inputs for which it succeeds with `true`.

## Signatures

```ts
export declare const filterEffect: {
    <A, E2, R2>(f: (a: A) => Effect.Effect<boolean, E2, R2>): <E, R>(sink: Sink<A, E | E2, R>) => Sink<A, E | E2, R | R2>;
    <A, E, R>(sink: Sink<A, E, R>, f: (a: A) => Effect.Effect<boolean, E, R>): Sink<A, E, R>;
};
```

## Why

A consumer can filter using service-backed or asynchronous policy without changing the producer.

## Ownership and lifetime

Each input runs one predicate Effect. `true` forwards once, `false` not at all, and predicate
failure reaches the sink's failure callback. The producer controls callback ordering and
concurrency; predicate services and interruption remain typed.

## Examples

```ts
import { Effect } from "effect"
import * as Sink from "@typed/fx/Sink"
const positive = Sink.filterEffect(Sink.make(Effect.logError, Effect.log), (n: number) => Effect.succeed(n > 0))
```
