[Haskell-cafe] Re: A monad using IO, Reader, Writer, State and Error

Martin Huschenbett huschi at gmx.org
Fri Apr 13 13:55:52 EDT 2007


Chris Kuklewicz schrieb:
> Martin Huschenbett wrote:
>> 1) type MyMonad = ErrorT E (RWST R W S IO)
>> 2) type MyMonad = RWST R W S (ErrorT E IO)
> 
> So (1) gives (Left e,s,w) or (Right a,s,w)
> and (2) gives (Left e) or (Right (a,s,w))
> 

Due to this fact i decided to use (1). If the operation fails and I get 
(Left e,s,w) what are the values of 's' and 'w'? Are they the state and 
the written things that were produced by the last successfull operation?

Regards,

Martin.



More information about the Haskell-Cafe mailing list