O'Reilly logo

Get Programming with Haskell by Will Kurt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Lesson 27. The Functor type class

After reading lesson 27, you’ll be able to

  • Use the Functor type class
  • Solve problems with fmap and <$>
  • Understand kinds for Functors

So far in this book, you’ve seen quite a few parameterized types (types that take another type as an argument). You’ve looked at types that represent containers, such as List and Map. You’ve also seen parameterized types that represent a context, such as Maybe for missing values and IO for values that come from the complex world of I/O. In this lesson, you’ll explore the powerful Functor type class. The Functor type class provides a generic interface for applying functions to values in a container or context. To get a sense of this, suppose you have the following types:

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required