Here&#x27;s a simple counter-example.<p>The state monad is the following functor<p><pre><code>    St s a = s -&gt; (a, s)
</code></pre>
if we compose it with itself (using `d` as the second state parameter)<p><pre><code>    St s (St d a) = s -&gt; (d -&gt; (a, d), s)
</code></pre>
is `F a = St s (St d a)` a monad? The return operation is clear enough<p><pre><code>    return a = \s -&gt; (\d -&gt; (a, d), s)
</code></pre>
but the join operation fails<p><pre><code>    join :: F (F a) -&gt; F a
         :: St s (St d (St s (St d a))) -&gt; St s (St d a)
         :: s -&gt; (d -&gt; (s -&gt; (d -&gt; (a, d), s), d), s)
         -&gt; s -&gt; (d -&gt; (a, d), s)

    join m0 = 
      \s0 -&gt; let (m1 :: St d (F a), s1) = m0 s0
             in (\d0 -&gt; let (m2 :: F a, d1) = m1 d0
                            (m3 :: St d a, s2) = m2 s1
                            (a, d2) = m3 d1
                        in (a, d2)
                , ??? )
</code></pre>
The trouble is the ??? bit where we&#x27;d like to place the furthest advanced `s` state named `s2`, but it&#x27;s not in scope to return at the top since we have to <i>apply the d state</i> to reach it.<p>This however only means that St does not compose with itself as a functor. It composes just fine in another method. If we install the inner monad &quot;wrapped around&quot; the tuple<p><pre><code>    StT s m a = s -&gt; m (a, s)      -- T for &quot;transformer&quot;
</code></pre>
then the composition of states looks like<p><pre><code>    StT s (St d) a = s -&gt; St d (a, s)
                   = s -&gt; d -&gt; ((a, s), d)
                   = (s, d) -&gt; (a, (s, d))
                   = St (s, d) a
</code></pre>
which is obviously a monad.