<div dir="ltr">On Mon, Jan 2, 2012 at 03:32, Steve Horne <span dir="ltr">&lt;<a href="mailto:sh006d3592@blueyonder.co.uk">sh006d3592@blueyonder.co.uk</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
BTW - interesting how the signatures of test1 and test2 are reported - I hadn&#39;t realised monad transformers were relevant there. Of course it does seem a bit silly to implement both StateT and State when StateT can implement State for you.</blockquote>
</div><br>If you&#39;re using the mtl1 library, State is separate from StateT.  With the transformers library (or mtl2, which is a wrapper for transformers) State is defined as StateT Identity.  Part of the reason for this is that older ghc didn&#39;t optimize very well with something like StateT Identity; part is simply because monad transformers came later and nobody bothered to go back and rework the standalone monads as transformers over an Identity monad.  The original Monad library included non-transformer-based multi-monads such as RWS (Reader+Writer+State) as well, since nobody has worked out transformers as a concept yet.<br clear="all">
<div><br></div>-- <br>brandon s allbery                                      <a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a><br>wandering unix systems administrator (available)     (412) 475-9364 vm/sms<br>
<br>
</div>