Re:Class Hierarchies? Don't Do That
by mercurial on Sunday March 30, 2014 @04:16PM
(#7497730)
Fair point. The problem is solved in Haskell by having default implementation in the typeclass, leaving the programmer with only a few methods to implement (eg, 'equals' is defined in terms of 'unequals' and vice-versa, implement the one you want to get the rest of the typeclass working).
That said, that's a fairly rare case. Classes with such a large surface are often a code smell.
That said, that's a fairly rare case. Classes with such a large surface are often a code smell.