In this chapter I will give you a “tour” through the predefined standard type classes in Haskell, as I did for lists in Chapter 23. These classes have been simplified somewhat by omitting some of the less interesting methods. The Haskell Report and Standard Library Report contain more complete descriptions.
24.1 The Ordered Class
The equality class Eq was defined precisely in Chapter 12, along with a simplified version of the class Ord. Here is its full specification of class Ord; note the many default methods:
Note that the default method for compare is defined in terms ...