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 ...

Get Web Development with ReasonML 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.