2 ms·
I would guess that a dislike for reduce overlaps with a preference with imperative languages. Filter and map are easy because you can make more assertions abou
by gorjusborg 16d ago
I would guess that a dislike for reduce overlaps with a preference with imperative languages.
Filter and map are easy because you can make more assertions about them without inspection:
- they take a list-like as input
- they take a function as input
- they return a list-like as output
As opposed to reduce:
- it takes a list-like as input
- it takes a function as input
The output type is not fixed, and its behavior is not fixed. If you pass the right function, reduce is filter, or map, or something else we've never seen.