Chapter 3. Patterns of Composition
Function composition is a fundamental part of functional programming. This chapter is concerned with exploring the composition characteristics of the fundamental type-classes: functor, applicative functor, arrow, and monad. We will see that functor embeds into applicative functor, which embeds into arrow, which embeds into monad. After exploring monad composition, we'll also look into monad transformers (a technique for composing different types of monads). As we move through the successive types, from the most general (functor) to the most powerful (monad), we will see how they differ in the ways they can be composed.
Note that this chapter does not have the last word on composition patterns, for example, in the following chapter we will explore another pattern for composition: functional lenses.
- Functor
- Applicative functor
- Monad
- Monad transformers
- Arrows