(combiner: Combiner.Combiner<A>)
| 169 | * @since 4.0.0 |
| 170 | */ |
| 171 | export function makeReducer<A>(combiner: Combiner.Combiner<A>): Reducer.Reducer<A | undefined> { |
| 172 | return Reducer.make((self, that) => { |
| 173 | if (self === undefined) return that |
| 174 | if (that === undefined) return self |
| 175 | return combiner.combine(self, that) |
| 176 | }, undefined as A | undefined) |
| 177 | } |
| 178 | |
| 179 | /** |
| 180 | * Creates a `Combiner` for `A | undefined` that combines values only when both |