Multiple constraint classes - the alternative to superclass
This is alternative to SuperClasses - multiple constraint Classes
class Monoid a where ... class Monad m => MonadPlus m where ...
It could be:
class Monoid a where ... class Monad m => Monoid m where ... class Arrow c => Monoid c where ... foo :: Monad m => Monoid m => m a
all classes must have same functions with same kind.
And if you wish to write superclass, it would be easy to write
class BeforeNum a where .... class BeforeNum a => Num a where ... foo :: BeforeNum a => Num a => a
If class have single constraint, you could write without it.
If class have many constrains, you could write without it, if it is empty one.
bar :: MonadPlus m => m a <<==>> bar :: Monad m => MonadPlus m => m a foo :: Monoid a => a <<==>> foo :: () => Monoid a => a