Koen suggests:

| The solution is real easy: To express the necessity of a Monad to be a
| Functor, change the definition of the class Monad as follows: 
| 
|   class Functor m => Monad m where
|     ...

When to make one class into a superclass of another is a rather tricky
matter of judgement:

      (a) If Functor is a superclass of Monad, then every instance
          of Monad must also be made an instance of Functor, whether
          or not one uses "map".  This can be tiresome.

      (b) On the other hand, it is never *necessary* to make one 
          class a superclass of another; it just makes contexts smaller.
          In Koen's example, he'd have to say:
                  class MonadTrans t where
                    lift :: (Functor m, Monad m) => m a -> t m a
          These extra contexts can be tiresome to write, too.

I don't think there's anything deeper to the Haskell 1.4 decision than that.

Simon



Reply via email to