Swift Reduce: Combining elements into a single value
Reduce is a typical functional pattern, a higher-order function that combines a collection into a single value cleanly and expressively. When I looked up how often I use it in RocketSim's codebase, I was quite surprised! Way more often than expected. Yet, I did not write about this function at all, so it's time to give it some proper attention.
Read the article