I&#39;m not exactly a Haskell beginner but haven&#39;t grasped much of it yet. I have a feeling the answer to your question has something to do with the fact that the monad transformer library provides instances that allow the use of, for example, &quot;get&quot; and &quot;put&quot; in any transformed monad that has a StateT somewhere in it. Or throwError in anything that has an ErrorT in it. In other words, you don&#39;t need to lift everything into the right level. <br>
<br>Okay, that&#39;s a crude way of putting it, but someone will probably come along and clarify.<br>Dennis<br><br><div class="gmail_quote">On Sat, Aug 25, 2012 at 1:15 AM, Song Zhang <span dir="ltr">&lt;<a href="mailto:vxanica@gmail.com" target="_blank">vxanica@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br clear="all"><div>When I use a State Monad transformer to combine with a Writer Monad</div><div>StateT s (Writer w) a. is it different from composition of State Monad and Writer Monad. It is State s (Writer w a) ?</div>

<div>StateT is defined as (s -&gt; m (a, s)), so StateT s (Writer w) a can be regarded as (s -&gt; Writer w a) , which is (s -&gt; ((a,w),s)</div><div>and on the other hand State s (Writer w a) is (s -&gt; ((a,w),s). I suppose the are similar and if so, what is the point we still get Monad transformers? Thanks</div>

<div><br></div><div><br></div><br>
<br>_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
<br></blockquote></div><br>