[Haskell-cafe] A catch-all MonadIO instance

2011-10-28 Thread Bas van Dijk
Hello, Is it unsafe to add the following catch-all MonadIO instance to transformers' Control.Monad.IO.Class module? {-# LANGUAGE FlexibleInstances, FlexibleContexts, UndecidableInstances #-} instance (MonadTrans t, Monad (t m), MonadIO m) = MonadIO (t m) where liftIO = lift . liftIO It

Re: [Haskell-cafe] A catch-all MonadIO instance

2011-10-28 Thread Antoine Latter
On Fri, Oct 28, 2011 at 9:11 AM, Bas van Dijk v.dijk@gmail.com wrote: Hello, Is it unsafe to add the following catch-all MonadIO instance to transformers' Control.Monad.IO.Class module? {-# LANGUAGE FlexibleInstances, FlexibleContexts, UndecidableInstances #-} instance (MonadTrans t,

Re: [Haskell-cafe] A catch-all MonadIO instance

2011-10-28 Thread Paterson, Ross
Bas van Dijk writes: Is it unsafe to add the following catch-all MonadIO instance to transformers' Control.Monad.IO.Class module? {-# LANGUAGE FlexibleInstances, FlexibleContexts, UndecidableInstances #-} instance (MonadTrans t, Monad (t m), MonadIO m) = MonadIO (t m) where liftIO =

Re: [Haskell-cafe] A catch-all MonadIO instance

2011-10-28 Thread Bas van Dijk
On 28 October 2011 16:23, Antoine Latter aslat...@gmail.com wrote: I would then need OverlappingInstances to declare a MonadIO instance for any similar looking instance head (that is `t m`) where 't' was not a proper MonadTrans instance, which sounds like a common enough things to do. I

Re: [Haskell-cafe] A catch-all MonadIO instance

2011-10-28 Thread Ertugrul Soeylemez
Bas van Dijk v.dijk@gmail.com wrote: I understand, portability is important for transformers. For monad-control it's less of an issue because I already use other language extensions (incl. RankNTypes). So I think I go ahead and add a catch-all instance for MonadControlIO to

Re: [Haskell-cafe] A catch-all MonadIO instance

2011-10-28 Thread Bas van Dijk
On 28 October 2011 16:59, Ertugrul Soeylemez e...@ertes.de wrote: I'm not sure whether this will work well.  You will get overlapping instances, and I don't see a way to hide instances when importing. Perhaps the OverlappingInstances extension could help here. You're right. I didn't get an