[Haskell-cafe] Why do I have to specify (Monad m) here again?

Bulat Ziganshin bulat.ziganshin at gmail.com
Sun Feb 18 10:59:32 EST 2007

Hello Marc,

Sunday, February 18, 2007, 7:32:54 PM, you wrote:

> When using your example (Monad IO):
>         class (Monad m) => MonadIO m where
>                 liftIO :: IO a -> m a
> it it basically the same, isn't it?  This declaration forces m to be monad..
> which would't hurt if GHC would infer m beeing a monad automatically?

it is more explicit. for example, this simplifies understanding of
error messages generated by compiler. and, if you change 'class'
declaration, this will not silently change meaning of 'instance' declaration

Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com

More information about the Haskell-Cafe mailing list