60 | | '''SLPJ''': are there any other design goals? |

| 60 | === Design goal 2: write implementations of sub-classes that imply their superclass implementations === |

| 61 | |

| 62 | Example 1: once you say |

| 63 | {{{ |

| 64 | instance Ord (T a) where |

| 65 | compare = ... |

| 66 | }}} |

| 67 | then the implementation of `(==)` in `Eq` is obvious. So, in the class decl for `Ord` we'd like to say (modulo syntax, see below) |

| 68 | {{{ |

| 69 | class Eq a => Ord a where |

| 70 | ... |

| 71 | instance Eq a where |

| 72 | (==) a b = case compare a b of { EQ -> True; _ -> False } |

| 73 | }}} |

| 74 | |

| 75 | Example 2: once you say `instance Monad M`, the instances for `Functor M` and `Applicative M` can be derivived from the definitions of `(>>=)` and `return`. And similarly if you say `instance Applicative M`, the `Functor M` instance is derivable. |

| 76 | |

| 77 | Example 3: once you say `instance Traversable T` you can derive `Foldable` and `Functor`. |

| 78 | |

| 79 | Obvious question: if something is both `Foldable` and `Applicative`, which `Functor` instance do you get? |

| 80 | |

| 81 | |