Haskell inheritance: What's inherity about it?
In practice, this means that all members of the subclass necessarily provide all methods of the superclass.
So, as in the linked example, we can write a method that requires Eq
, but only give it an Ord
constraint, and the Eq
methods are implied for us.
(Note that inheritance is probably a terrible term for this, because it carries a lot of associations that don't make sense in our context. Nonetheless, I figured I might as well explain it.)