Import
import { withEarlyExit } from "@typed/fx/Sink";Signatures
export declare function withEarlyExit<A, E, R, R2>(sink: Sink<A, E, R>, f: (sink: Sink.WithEarlyExit<A, E, R>, params: {
signal: AbortSignal;
scheduler: Scheduler;
}) => Effect.Effect<unknown, never, R2>): Effect.Effect<void, never, R | R2>;Why
Consumer combinators can stop upstream work after a bound or predicate without representing normal completion as failure.
Ownership and lifetime
The returned Effect owns the callback fiber. Completion, earlyExit, or interruption aborts that
fiber through the supplied signal; deliveries after exit are ignored. The callback’s services are
combined with the wrapped sink’s services.
Examples
import { Effect } from "effect"
import * as Sink from "@typed/fx/Sink"
const base = Sink.make(Effect.logError, Effect.log)
const program = Sink.withEarlyExit(base, (sink) => sink.onSuccess("done").pipe(Effect.andThen(sink.earlyExit)))Other public imports
These import paths expose the same declaration. Each page retains its own public name and signature.