[Haskell-beginners] monad transformers
Michael P Mossey
mpm at alumni.caltech.edu
Fri Aug 14 20:55:02 EDT 2009
In Martin Grabmuller's tutorial "Monad Transformers Step by Step", found here
http://user.cs.tu-berlin.de/~magr/pub/Transformers.pdf
he gives an example of composing ErrorT, StateT, ReaderT, and WriterT. Early in
the paper, where he composes just ErrorT and ReaderT
type Eval3 a = ReaderT Env (ErrorT String Identity) a
he uses 'ask' and 'throwError' in some example code. I notice that he doesn't
have to lift throwError into the ErrorT monad. Why is this? Do I misunderstand
something about monad transformers? Is it a convenience definition of throwError?
Same thing the rest of the paper. I don't see anywhere he lifts anything.
Thanks,
Mike
More information about the Beginners
mailing list