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

Function collectAllUntilEffect

packages/effect/src/internal/sink.ts:190–199  ·  view source on GitHub ↗
(p: (input: In) => Effect.Effect<boolean, E, R>)

Source from the content-addressed store, hash-verified

188
189/** @internal */
190export const collectAllUntilEffect = <In, E, R>(p: (input: In) => Effect.Effect<boolean, E, R>) => {
191 return pipe(
192 foldEffect<[Chunk.Chunk<In>, boolean], In, E, R>(
193 [Chunk.empty(), true],
194 (tuple) => tuple[1],
195 ([chunk, _], input) => pipe(p(input), Effect.map((bool) => [pipe(chunk, Chunk.append(input)), !bool]))
196 ),
197 map((tuple) => tuple[0])
198 )
199}
200
201/** @internal */
202export const collectAllWhile: {

Callers

nothing calls this directly

Calls 5

foldEffectFunction · 0.85
pipeFunction · 0.70
mapMethod · 0.65
pFunction · 0.50
mapFunction · 0.50

Tested by

no test coverage detected