Did you try to use transformers instead of mtl? I am just in doubt about it in my work. <br><br>I&#39;ve found that Conduit use it. So you remove extra dependency.<br>I hope that transformers have more readable messages (without FD) and you can control what is &quot;lift&quot; more clear.<br>
<br>I have no experience although.<br><br><br><br><div class="gmail_quote">2012/3/2 Alexander V Vershilov <span dir="ltr">&lt;<a href="mailto:alexander.vershilov@gmail.com">alexander.vershilov@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I&#39;ve found a solution, I should not use lift for runWriterT, and should<br>
explicilty lift all computation of level I need, i.e. (lift.lift) for ask<br>
and lift for register.<br>
<div class="im HOEnZb"><br>
Thu, Mar 01, 2012 at 02:19:29PM +0400, Dmitry Olshansky wrote<br>
</div><div class="HOEnZb"><div class="h5">&gt; &gt;&gt; If I&#39;m running register outside runWriterT everything will work.<br>
&gt;<br>
&gt; Maybe just<br>
&gt;<br>
&gt; &gt; lift $ register $ print &quot;freed2&quot;<br>
&gt;<br>
&gt; or I didn&#39;t catch something?<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; 2012/3/1 Alexander V Vershilov &lt;<a href="mailto:alexander.vershilov@gmail.com">alexander.vershilov@gmail.com</a>&gt;<br>
&gt;<br>
&gt;     Hello.<br>
&gt;<br>
&gt;     I&#39;m trying to add monad stack into network-conduit, and everything<br>
&gt;     works except some details [1].<br>
&gt;<br>
&gt;     I&#39;ve run runReaderT $ runTCPServer (wrapper around runResourceT) and<br>
&gt;     inside conduit I want to run writer to gather results of inner computation.<br>
&gt;     In inner computation I want to use IO, data from outter stack (ReaderT)<br>
&gt;     so I&#39;m running {-1-}:<br>
&gt;<br>
&gt;      (k,t) &lt;- lift $ runWriterT $ ask &gt;&gt;= \x -&gt; tell [x]     {- 1 -}<br>
&gt;<br>
&gt;     and {-2-}<br>
&gt;<br>
&gt;      (k,t) &lt;- lift $ runWriterT $ do {- 2 -}<br>
&gt;                        x &lt;- ask<br>
&gt;                        liftIO $ print $x+1<br>
&gt;                        tell [x]<br>
&gt;<br>
&gt;     and that will work (except I&#39;ve thought I should not lift runWriterT, but<br>
&gt;     calling functions inside.<br>
&gt;<br>
&gt;     And finally in computation that will run once I want to register cleaning<br>
&gt;     function (for example register $ putStrLn &quot;cleaned&quot;) ({-3-})<br>
&gt;<br>
&gt;      (k,t) &lt;- lift $ runWriterT $ do {- 3 -}<br>
&gt;                        x &lt;- ask<br>
&gt;                        liftIO $ print $x+1<br>
&gt;                        register $ print &quot;freed2&quot;<br>
&gt;                        tell [x]<br>
&gt;<br>
&gt;     but I&#39;ve got type error. If I&#39;m running register outside runWriterT<br>
&gt;     everything<br>
&gt;     will work.<br>
&gt;<br>
&gt;     I would apperated if there will be any suggestions how to make this code<br>
&gt;     better or use register in internal computation (runWriterT)<br>
&gt;<br>
&gt;     [1] <a href="https://gist.github.com/1941151" target="_blank">https://gist.github.com/1941151</a><br>
&gt;     --<br>
&gt;     Best regards,<br>
&gt;      Alexander V Vershilov<br>
&gt;<br>
&gt;     _______________________________________________<br>
&gt;     Haskell-Cafe mailing list<br>
&gt;     <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
&gt;     <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div><br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br>