content: data Trivial = 
    Trivial'
  
  instance Eq Trivial where
    Trivial' == Trivial' = True
  
  data DayOfWeek =
    Mon | Tue | Wed | Thu | Fri | Sat | Sun
    deriving (Show)
  
  -- Day of week and numerical day of month
  
  data Date =
    Date DayOfWeek Int
  
  instance Eq DayOfWeek where
    (==) Mon Mon = True
    (==) Tue Tue = True
    (==) Wed Wed = True
    (==) Thu Thu = True
    (==) Fri Fri = True
    (==) Sat Sat = True
    (==) Sun Sun = True
    (==) _ _     = False
  
  instance Ord DayOfWeek where
    compare Fri Fri = EQ
    compare Fri _ = GT
    compare _ Fri = LT
    compare _ _ = EQ
  
  
  instance Eq Date where
    (==) (Date weekday monthNum)
         (Date weekday' monthNum') =
      weekday == weekday' && monthNum == monthNum'
  
  
  f :: Int -> Bool
  f 1 = True
  f 2 = True
  f _ = False
  
  data Identity a =
    Identity a
  
  instance Eq a => Eq (Identity a) where
    (==) (Identity v) (Identity v') = v == v'
  
  data TisAnInteger =
    TisAn Integer
  
  instance Eq TisAnInteger where
    (==) (TisAn a) (TisAn a') = a == a'
  
  data TwoIntegers =
    Two Integer Integer
  
  instance Eq TwoIntegers where
    (==) (Two a b) (Two a' b') =
      a == a' && b == b'
  
  data StringOrInt =
    TisAnInt Int
    | TisAString String
  
  instance Eq StringOrInt where
    (==) (TisAnInt a) (TisAnInt a') = a == a'
    (==) (TisAString a) (TisAString a') = a == a'
    (==) _ _ = False
  
  data Pair a =
    Pair a a
  
  instance Eq a => Eq (Pair a) where
    (==) (Pair a a') (Pair b b') = a == b && a' == b'
  
  data Tuple a b =
    Tuple a b
  
  instance (Eq a, Eq b) => Eq (Tuple a b) where
    (==) (Tuple a a') (Tuple b b') = a == b && a' == b'
  
  data Which a =
      ThisOne a
      | ThatOne a
  
  instance Eq a => Eq (Which a) where
    (==) (ThisOne a) (ThisOne a') = a == a'
    (==) (ThatOne a) (ThatOne a') = a == a'
    (==) _ _ = False
  
  data EitherOr a b =
    Hello a
    | Goodbye b
  
  instance (Eq a, Eq b) => Eq (EitherOr a b) where
    (==) (Hello a) (Hello a') = a == a'
    (==) (Goodbye a) (Goodbye a') = a == a'
    (==) _ _ = False
  