[Haskell-cafe] implementing try for RWST ?

2007-04-13 Thread Jeremy Shaw
Hello, I defined a newtype like this (the ()s will be replace with something more useful in the future): > newtype DryRunIO a = DryRunIO { runDryRunIO :: RWST Bool () () IO a } >deriving (Monad, MonadIO, MonadError IOError, MonadFix, Functor, > MonadReader Bool, MonadWriter (), MonadState ()

[Haskell-cafe] implementing try for RWST ?

2007-04-16 Thread oleg
The examples presented so far seem to show that the computation will eventually run in the IO monad. One may wonder then why do we need RWST transformer, given that the IO monad can implement both the state and writer. At the very least me need the reader transformer, which is the least demanding

Re: [Haskell-cafe] implementing try for RWST ?

2007-04-16 Thread tpledger
Jeremy Shaw wrote: : | However, I think this is buggy, because changes | to 's' and 'w' will be lost if 'm' raises an | exception. : That's determined by the way you stack your monad transformers when declaring the type: adding error handling to a writer monad, or adding writing to an error

Re: [Haskell-cafe] implementing try for RWST ?

2007-04-16 Thread Jeremy Shaw
At Tue, 17 Apr 2007 09:46:19 +1200, [EMAIL PROTECTED] wrote: } } Jeremy Shaw wrote: } : } | However, I think this is buggy, because changes } | to 's' and 'w' will be lost if 'm' raises an } | exception. } : } } } That's determined by the way you stack your monad } transformers when declari

Re: [Haskell-cafe] implementing try for RWST ?

2007-04-16 Thread Brandon S. Allbery KF8NH
On Apr 17, 2007, at 0:03 , [EMAIL PROTECTED] wrote: eventually run in the IO monad. One may wonder then why do we need RWST transformer, given that the IO monad can implement both the state For what it's worth, I got the impression that RWST was an example of a complex monad transformer ---

Re: [Haskell-cafe] implementing try for RWST ?

2007-04-17 Thread Chris Kuklewicz
Brandon S. Allbery KF8NH wrote: > > On Apr 17, 2007, at 0:03 , [EMAIL PROTECTED] wrote: >> eventually run in the IO monad. One may wonder then why do we need >> RWST transformer, given that the IO monad can implement both the state > > For what it's worth, I got the impression that RWST was an ex