class Monad m where
          return :: m a
          (>>=)  :: m a -> (a -> m b) -> m b
          (>>)   :: m a -> m b -> m b

          fail :: String -> m a
          fail s = error s

        IO.fail becomes IO.ioError

Looks good.

        class Monad m => MonadPlus m where
          mzero :: m a
          mplus :: m a -> m a -> m a

Why is this here?  It doesn't need to be in the prelude.  Just
leave it for the user to define (and then the user may pick
better names, like Ringad, zero, and <+>).  -- P




Reply via email to