(p: (input: In) => Effect.Effect<boolean, E, R>)
| 188 | |
| 189 | /** @internal */ |
| 190 | export 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 */ |
| 202 | export const collectAllWhile: { |
nothing calls this directly
no test coverage detected