10
Functors, Applicative Functors, and Traversables
This chapter leads us much further into Haskell’s hierarchy of type classes for type constructors: functors, applicative functors, and traversables.
We will introduce the three abstractions in turn as a generalization of particular list-related functionality: mapping, zipping, and mapping with zipping. These list functions provide a good intuition for the mechanics of the generalizations. However, for applicative functors, the notion of effectful computations provides a much better and more important intuition.
Effectful computations are computations that do not only (or necessarily) produce a result. They also do or can do something additional (such as logging, failing, or changing a mutable ...
Get Soar with Haskell 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.