12 Applicative and traversable functors

This chapter covers

  • Defining the applicative and traversable functor algebraic structures
  • Applicatives and monads: relationship, differences, and trade-offs
  • Proving applicative laws
  • Working with traversable structures
  • Monad composition using the monad transformer

In the previous chapter on monads, we saw how a lot of the functions we’ve been writing for different data types and combinator libraries can be expressed in terms of a single interface, Monad. Monads provide powerful functionality, as we’ve seen by the fact that we can use flatMap to write what seems like an imperative program in a purely functional way.

In this chapter, we learn about a related abstraction, the applicative functor, which ...

Get Functional Programming in Kotlin 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.