Summary

This chapter focused on ways of composing functions and types. We saw that Functor, Applicative, Arrow and Monad all fall on a spectrum of generality, with Monad being the most powerful type.

We also found how different the historical development of these types were from their natural order in the abstraction hierarchy. This explained the redundancies in type-class methods across these types.

In the next chapter, we'll explore how folding and traversing (something we're very used to when working with lists) can be generalized to Applicative and Monad. To get to the heart of folding, we'll take a good look at the very simple and powerful Monoid type and see how intricately it is related to folding over data types.

We'll also learn about functional ...

Get Haskell Design Patterns 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.