Weight-based random sampling

I do see it quite the opposite. reduce/fold or however you might call it, is a well understood pattern in FP, using it should happen from the muscle memory.

Directly writing out the recursion though, is in my opinion not as readable as a clearly named reduce. To do the reverse mapping, I have to understand the full recursive function to see, whether it reduces a list to a single value, if it maps a function over the list, or does even flatten things out on the way…

With Enum.x I clearly see the intend.

Also, as remote calls are more expensive than local ones on the BEAM, writing out the recursion is actually the optimisation…

Of course, one should be able to implement some functions in Enum on their own (for lists at least). map, reduce, reverse, concat, those are my personal favorites…