MCPcopy Index your code
hub / github.com/Effect-TS/effect / foldUntil

Function foldUntil

packages/effect/src/internal/sink.ts:1072–1080  ·  view source on GitHub ↗
(s: S, max: number, f: (s: S, input: In) => S)

Source from the content-addressed store, hash-verified

1070
1071/** @internal */
1072export const foldUntil = <S, In>(s: S, max: number, f: (s: S, input: In) => S): Sink.Sink<S, In, In> =>
1073 pipe(
1074 fold<[S, number], In>(
1075 [s, 0],
1076 (tuple) => tuple[1] < max,
1077 ([output, count], input) => [f(output, input), count + 1]
1078 ),
1079 map((tuple) => tuple[0])
1080 )
1081
1082/** @internal */
1083export const foldUntilEffect = <S, In, E, R>(

Callers

nothing calls this directly

Calls 4

foldFunction · 0.85
pipeFunction · 0.70
fFunction · 0.50
mapFunction · 0.50

Tested by

no test coverage detected