Import
import { Sink } from "@typed/fx";Access Sink.filterMapLoopCauseEffect through the imported Sink export. Its declaration below describes the member.
This public exposure is a re-export. Its import path is supported; declaration documentation is shared with the other public exposures below.
Signatures
export declare function filterMapLoopCauseEffect<A, E, R, B, E2, R2, C>(sink: Sink<A, E2 | C, R>, seed: B, f: (acc: B, a: Cause.Cause<E>) => Effect.Effect<readonly [
Option.Option<Cause.Cause<C>>,
B
], E2, R2>): Sink<A, E, R | R2>;Why
It supports service-backed, stateful failure suppression or translation at the consumer boundary.
Ownership and lifetime
Callback invocation constructs a transition Effect from the seed visible at that moment. The
adapter does not serialize those Effects: overlapping failures can read the same seed, and
successful transitions commit in completion order. Some forwards one cause, None suppresses
it, and transition failure is forwarded without committing. Successes pass through. The sink
instance retains its seed across producer runs; construct a new one to reset it.
Examples
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 sink = Sink.filterMapLoopCauseEffect(target, false, (seen, cause: Cause.Cause<string>) =>
Effect.succeed([seen ? Option.none() : Option.some(cause), true] as const))Other public imports
These import paths expose the same declaration. Each page retains its own public name and signature.