effect-io-ai

Package: effect
Module: Sink

Sink.foldUntil

Creates a sink that folds elements of type In into a structure of type S until max elements have been folded.

Like Sink.foldWeighted, but with a constant cost function of 1.

Signature

declare const foldUntil: <In, S>(s: S, max: number, f: (s: S, input: In) => S) => Sink<S, In, In>

Source

Since v2.0.0