Comment by KingMob

3 hours ago

But that's not actually guaranteed at all.

You "accumulate" an answer one item at a time, but there's no guarantee any dimensions are getting reduced.

You can easily duplicate the effects of map with reduce, for example, so the dims would stay the same. You could even expand dimensions, if you like, turning a 1-d array with n elements into an s X t 2-d array. If the reducing function tracks the total number of elements seen, it can easily know when to start a new row.

This is part of why people keep pointing out the name, "reduce", is a bit misleading.