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 ()
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
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
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
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 ---
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