Unit 5. Working with type in a context
In this unit, you’ll take a look at three of Haskell’s most powerful and often most confusing type classes: Functor, Applicative, and Monad. These type classes have funny names but a relatively straightforward purpose. Each one builds on the other to allow you to work in contexts such as IO. In unit 4, you made heavy use of the Monad type class to work in IO. In this unit, you’ll get a much deeper understanding of how that works. To get a better feel for what these abstract type classes are doing, you’ll explore types as though they were shapes.
One way to understand functions is as a means of transforming one type into another. Let’s visualize two types as two shapes, a circle and a square, as shown in ...
Get Get Programming 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.