Chapter 11. Higher kinded types and beyond

This chapter covers

  • Applying map() to various other types
  • Encapsulating error propagation
  • Understanding monads and their applications
  • Finding resources for further study

Throughout the book, we’ve looked at various versions of a very common algorithm, map(), and in chapter 10 we saw how iterators provide an abstraction that allows us to reuse it across various data structures. In this chapter, we’ll see how we can extend this algorithm beyond iterators and provide an even more general version. This powerful algorithm allows us to mix and match generic types and functions, and can help by providing a uniform way to handle errors.

After we go over a few examples, we’ll provide a definition for this ...

Get Programming with Types 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.