Summary
In this chapter, you learned about the Functor, Applicative, and Monad type classes, and how to work with lawful type classes. You’ll work with these type classes regularly, so getting a good understanding of how they work and why they work they way they do is useful. Of equal importance, in this chapter you got a chance to see first hand how to design and implement type classes that have a wide variety of uses with highly divergent behavior that still adhere to the basic laws of the classes.
Later on in this book you’ll build your own parser and define new Functor, Applicative, and Monad instances for a brand new type of computation. After that, you’ll learn how build new Monad instances by composing the behaviors of existing instances ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access