A Functional way to write map and then reduce?

It’s completely correct and efficient, just for a simple(functional) and efficient implementation.