Explicit recursion is rarely used in FP, and it's often a code smell. It's almost always better to use higher order functions instead. The advantage is that you can implement a particular transformation once, check for edge cases, and reuse it from there on. You also end up with declarative code that talks about what it's doing without distracting your with implementation details. Clojure has a rich set of functions for manipulating data such as map, filter, reduce, and so on. There are also libraries such as Specter [link] that allow you to declaratively transform complex data. I highly recommend watching this ▶ this video short video to see how it works.
in “Why I'm Productive in Clojure (2013)” · View on HN