Closed k0ral closed 9 years ago
Unfortunately, this is unavoidable with the current library ecosystem. Most libraries we depend on prefer MonadIO
, whereas monad-control and its users need MonadBase IO
generally. I agree, it's not ideal.
Then you might want to define the following shortcut in ClassyPrelude
:
{-# LANGUAGE ConstraintKinds #-}
type MonadBaseIO m = (MonadBase IO m, MonadIO m)
That is what I do. I call it ControlIO
@gregwebs If you think it's worth including such as type synonym, go for it. But we're not going to be able to solve the general problem of MonadBase IO
vs MonadIO
, so closing this issue.
In
ClassyPrelude
are currently exported some functions that use theMonadIO
typeclass (e.g. re-exports fromControl.Concurrent.MVar.Lifted
), and others that use theMonadBase IO
one (e.g.ClassyPrelude.atomically
).Seeing as both provide basically the same feature, I would expect
ClassyPrelude
to be a consistent bundle and take sides on this matter (preferably theMonadBase IO
one, if you ask me).I wouldn't know how to implement it though, turning a
MonadBase IO m => m a
into aMonadIO m => m a
, or the other way round. Do you have any insights ?