O'Reilly logo
  • Chris Pickett thinks this is interesting:

This example shows something new: the => symbol. Everything before this symbol is called a class constraint. We can read this type declaration like this: The equality function takes any two values that are of the same type and returns a Bool. The type of those two values must be an instance of the Eq class.


Cover of Learn You a Haskell for Great Good!


(==) :: Eq a => a -> a -> Bool