(
options: {
readonly initial: S
readonly maxCost: number
readonly cost: (s: S, input: In) => number
readonly decompose: (input: In) => Chunk.Chunk<In>
readonly body: (s: S, input: In) => S
}
)
| 1110 | |
| 1111 | /** @internal */ |
| 1112 | export const foldWeightedDecompose = <S, In>( |
| 1113 | options: { |
| 1114 | readonly initial: S |
| 1115 | readonly maxCost: number |
| 1116 | readonly cost: (s: S, input: In) => number |
| 1117 | readonly decompose: (input: In) => Chunk.Chunk<In> |
| 1118 | readonly body: (s: S, input: In) => S |
| 1119 | } |
| 1120 | ): Sink.Sink<S, In, In> => |
| 1121 | suspend(() => |
| 1122 | new SinkImpl( |
| 1123 | foldWeightedDecomposeLoop( |
| 1124 | options.initial, |
| 1125 | 0, |
| 1126 | false, |
| 1127 | options.maxCost, |
| 1128 | options.cost, |
| 1129 | options.decompose, |
| 1130 | options.body |
| 1131 | ) |
| 1132 | ) |
| 1133 | ) |
| 1134 | |
| 1135 | /** @internal */ |
| 1136 | const foldWeightedDecomposeLoop = <S, In>( |
no test coverage detected