We cover:

  • The recursive structure of lists
  • Traversing and building lists
  • Accumulators
  • Implementing map and reduce

Chapter 7Lists and Recursion

When we program with lists in conventional languages, we treat them as things to be iterated—it seems natural to loop over them. So why do we have a chapter on lists and recursion? Because if you look at the problem in the right way, recursion is a perfect tool for processing lists.

Get Programming Elixir 1.2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.