Using map, keep, and reduce with Lists
Before we get started on this section, you might be having a slight case of déjà vu—haven’t we already covered map in the discussion of option? Yes and no. The plain truth is that the word map occurs in a large number of contexts in functional programming. Almost any time you find a construct that’s even remotely like the mathematical idea of a function mapping a domain onto a range, sure enough, someone has slapped the term map onto it. The map in this section isn’t the same as the one you saw before, and—fair warning—it’s not the last time you’ll see that term pop up in this book.
Now that we’ve done the housekeeping and laundry, it’s time to use list functions to process the data in a list. Consider ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access