Summary
In this chapter, we saw how type classes provide a powerful mechanism for ad hoc overloading. We learned how to instantiate existing type classes with new types, and what key type classes in the standard library are. In addition, we studied several uses of type classes, both in the standard library and in a small case study.
Chapter 7, Lazy Evaluation, moves on to another remarkable feature of Haskell, its lazy evaluation strategy. A language’s evaluation strategy determines the order in which different parts of a program are executed. We will learn how Haskell’s approach works, how it deviates from that of most other languages, and what its benefits and gotchas are.