( s: S, max: number, f: (s: S, input: In) => Effect.Effect<S, E, R> )
| 1081 | |
| 1082 | /** @internal */ |
| 1083 | export const foldUntilEffect = <S, In, E, R>( |
| 1084 | s: S, |
| 1085 | max: number, |
| 1086 | f: (s: S, input: In) => Effect.Effect<S, E, R> |
| 1087 | ): Sink.Sink<S, In, In, E, R> => |
| 1088 | pipe( |
| 1089 | foldEffect( |
| 1090 | [s, 0 as number] as const, |
| 1091 | (tuple) => tuple[1] < max, |
| 1092 | ([output, count], input: In) => pipe(f(output, input), Effect.map((s) => [s, count + 1] as const)) |
| 1093 | ), |
| 1094 | map((tuple) => tuple[0]) |
| 1095 | ) |
| 1096 | |
| 1097 | /** @internal */ |
| 1098 | export const foldWeighted = <S, In>( |
nothing calls this directly
no test coverage detected