How come the following
foo :: MonadIO m => m ()
foo = print "hi"
causes the following error
Couldn't match type ‘m’ with ‘IO’ ‘m’ is a rigid type variable bound by the type signature for: foo :: forall (m :: * -> *). MonadIO m => m () at foo.hs:57:8 Expected type: m () Actual type: IO ()
As far as I know, shouldn't the MonadIO constraint allow this to work since IO () should be equal to a MonadIO ?