Thanks Bryan,<div><br></div><div>To summarize, embed IORef inside ReaderT and use that IORef to read/change the file path info, both in IO monad and MyState monad. Is this right?</div><div><br></div><div>Thank you all!</div>
<div><br></div><div>jinwoo</div><div><br><br><div class="gmail_quote">On Sat, Apr 5, 2008 at 1:56 AM, Bryan O&#39;Sullivan &lt;<a href="mailto:bos@serpentine.com">bos@serpentine.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="Ih2E3d">Jinwoo Lee wrote:<br>
<br>
&gt; I haven&#39;t used ReaderT. What are the advantages when using ReaderT<br>
&gt; instead of StateT in this case?<br>
<br>
</div>A StateT lets you replace one IORef with another, since it gives you<br>
mutable state. &nbsp;A ReaderT gives you *immutable* state, so the type<br>
system guarantees that you&#39;ll always be using the same IORef.<br>
<font color="#888888"><br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;b<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Jinwoo Lee<br>Always remember that you are unique. Just like everyone else.
</div>