In principle that is a nice way to do it, and given that reduce is implemented natively on some platforms it might even be sufficiently performant, but to be honest I'd probably just write them as loops mutating a local variable. A language runtime is one of the places where a little bit of readability can be sacrificed for performance (although of course, one should measure it to make sure the gains are worth the cost).
Someone has actually already submitted a pull request doing just this:
Someone has actually already submitted a pull request doing just this:
https://github.com/jcoglan/fargo/pull/3