A type constraint limits a polymorphic type to values supporting a required type-class interface. Writing `Eq a =>` allows a function to use equality on `a`. section 5.1.3
Use constraints when a function depends on operations supplied by a type class:
- Declare `member :: Eq a => a -> [(a, b)] -> Bool` because checking a key with `(==)` requires `Eq a`. section 5.1.4
- Omit the constraint when the type is explicit, because a concrete type such as `Int` already determines its available instance. section 5.1.3
- Propagate constraints through helper functions: `hasNode :: Eq a => DiGraph a -> a -> Bool` uses the same equality requirement. section 5.1.4
Checking membership in an associative list
The recursive `member` function returns `True` when a key matches with `(==)` and otherwise continues through the list. Its `Eq a` constraint prevents calls with types that cannot be compared for equality. section 5.1.4
ghci> :info Eq
type Eq :: * -> Constraint
class Eq a where
(==) :: a -> a -> Bool
(/=) :: a -> a -> Bool
{-# MINIMAL (==) | (/=) #-}
Inspecting `Eq` in GHCi shows `Constraint` as the kind of type-class constraints and exposes the class operations. section 5.1.3
At the kind level, `Constraint` represents a requirement such as `Eq a` or `Functor f`, rather than an ordinary value-producing type. Thus `Functor []` is a constraint and cannot define a data field. section 8.2.3





