<div dir="ltr">Cool. I think I get so i'll have a go.<div>Thanks again<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 7, 2014 at 3:21 AM, Brandon Allbery <span dir="ltr"><<a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="h5">On Mon, Jan 6, 2014 at 10:15 PM, Courtney Robinson <span dir="ltr"><<a href="mailto:courtney@crlog.info" target="_blank">courtney@crlog.info</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jan 7, 2014 at 3:03 AM, Brandon Allbery <span dir="ltr"><<a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>></span> wrote:<br>




<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">behind </blockquote></div><br>Oh I see, thanks for the info. really helpful.</div><div class="gmail_extra">It brings about another question now.</div>




<div class="gmail_extra"><br></div><div class="gmail_extra">How is newIORef meant to be used so that I only have a single IORef?</div></div></blockquote><div><br></div></div></div><div>The Haskell way is to carry such things implicitly in a State or Reader monad; since the IORef itself doesn't change, and you need the IO monad around anyway to actually use it, you would use a ReaderT IORef IO and then use ask >>= liftIO . readIORef to get the value and similar to write or modify it. (Commonly one uses a type or newtype+newtype deriving to make one's own monad combining them.)</div>


<div><br></div></div><div class="im">-- <br><div dir="ltr"><div>brandon s allbery kf8nh                               sine nomine associates</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>                                  <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div>


<div>unix, openafs, kerberos, infrastructure, xmonad        <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div></div>
</div></div></div>
<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><br clear="all"><div><br></div>-- <br>Courtney Robinson<br><a href="mailto:courtney@crlog.info" target="_blank">courtney@crlog.info</a><br><div><div><a href="http://crlog.info/" target="_blank">http://crlog.info</a></div>

<div>07535691628 (No private #s)</div></div>
</div>