Re: [Haskell-cafe] Re: Control.Exceptions and MonadIO

2006-04-24 Thread Brian Hulley
Brian Hulley wrote: I've started work on a module to replace Control.Exception by wrapping all the original Control.Exception functions in more general monadic functions and using two type classes as follows: class MonadIO m => MonadException m where catch :: m a -> (Exception -> m a) -> m a

[Haskell-cafe] Re: Control.Exceptions and MonadIO

2006-04-23 Thread Robert Dockins
On Sunday 23 April 2006 02:19 pm, you wrote: [snip some discussion] > Perhaps something like: > > class MonadIO m => MonadIOE m where > catch :: m a-> (Exception -> m a) -> m a > throw > catchDyn > throwDyn > -- etc > > instance MonadIOE m => StateT s m where ... > instan

Re: [Haskell-cafe] Re: Control.Exceptions and MonadIO

2006-04-23 Thread Brian Hulley
I've started work on a module to replace Control.Exception by wrapping all the original Control.Exception functions in more general monadic functions and using two type classes as follows: class MonadIO m => MonadException m where catch :: m a -> (Exception -> m a) -> m a catchDyn :: Ty

Re: [Haskell-cafe] Re: Control.Exceptions and MonadIO

2006-04-23 Thread Brian Hulley
Brian Hulley wrote: instance MonadIOE m => StateT s m where ... instance MonadIOE m => ReaderT r m where ... instance MonadIOB m => ReaderT r m where ... Ooops! ;-) instance MonadIOE m => MonadIOE (StateT s m) where ... instance MonadIOE m => MonadIOE (ReaderT r m) where ... instance MonadIO

[Haskell-cafe] Re: Control.Exceptions and MonadIO

2006-04-23 Thread Brian Hulley
[EMAIL PROTECTED] wrote: Robert Dockins wrote: One additional (very unfortunate) point is that higher-order IO monad combinators will not work on your monad, eg, the ones in Control.Exception. Although that is true in general, for many useful and interesting cases (including ReaderT, the state

[Haskell-cafe] Re: Control.Exceptions and MonadIO

2006-04-22 Thread Brian Hulley
[EMAIL PROTECTED] wrote: Robert Dockins wrote: One additional (very unfortunate) point is that higher-order IO monad combinators will not work on your monad, eg, the ones in Control.Exception. Although that is true in general, for many useful and interesting cases (including ReaderT, the state