⚠️ This post links to an external website. ⚠️
“When an operation cannot be expressed by any of the functions in the Enum module, developers will most likely resort to reduce/3.”
From the docs for Enum.reduce/3
In many Elixir applications, I find
Enum.reduceis used frequently.Enum.reducecan do anything, but that doesn’t mean it should. In many cases, other Enum functions are more readable, practically as fast, and easier to refactor.I would also like to discuss situations that are a good fit for
Enum.reduceand also introduce you to a customcredocheck I’ve created, which can help you identify places whereEnum.reducecould be replaced with a simpler option.
continue reading on www.erlang-solutions.com
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.