[Haskell-beginners] Difference between Monad composition and transformation

Song Zhang vxanica at gmail.com
Sat Aug 25 10:15:20 CEST 2012

When I use a State Monad transformer to combine with a Writer Monad
StateT s (Writer w) a. is it different from composition of State Monad and
Writer Monad. It is State s (Writer w a) ?
StateT is defined as (s -> m (a, s)), so StateT s (Writer w) a can be
regarded as (s -> Writer w a) , which is (s -> ((a,w),s)
and on the other hand State s (Writer w a) is (s -> ((a,w),s). I suppose
the are similar and if so, what is the point we still get Monad
transformers? Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20120825/acd963f9/attachment.htm>

More information about the Beginners mailing list