I was toying with Haskell classes and came across
Functor-Applicative-Monad proposal. It shows out that adding
a super class (Applicative) to a class (Monad) is not an easy task when
the class hierarchy is already in use.
In this case it result in stepwise approach (step1 e. g. ) in order
not to break already existing code which uses Monad.
I am interested in other examples of such changes. Which alterings of
your class hierarchy do you usually need when rewriting your code? I
don't mean only adding superclass here, other modifications could be
also handy, e. g. dropping out a class or splitting a class into two.
Can you point me to some actual examples on real source code? How do
you deal with this kind of problem on your projects?
The Functor-Applicative-Monad hierarchy change has been a difficult
change _because_ Functor and Monad are primary parts to the Prelude
(standard library). Individual projects don't change the standard
library, so changing a class hierarchy is no more problematic than any
other substantial / breaking change to a code base.