<div dir="ltr">On Wed, Jul 11, 2012 at 8:00 PM, Qi Qi <span dir="ltr">&lt;<a href="mailto:qiqi789@gmail.com" target="_blank">qiqi789@gmail.com</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">
List [] is a monad, why not for heap data. Heap data could be an instance of Monad too. <br></blockquote><div><br></div><div>Only if you can define a meaningful semantics for it.  Lists aren&#39;t a monad because of liftIO, but because the monad pattern means something (backtracking/multiple evaluation).  What does the monad pattern mean for your heap?</div>
<div><br></div><div>I&#39;m not saying there *isn&#39;t* one; I&#39;m saying that you must *have* one in order to make a monad.  Monads are not simply some sneaky way to slipstream I/O into expressions; IO is just one possible monad, and many programs make heavier use of other monads such as state and reader.  And in particular, most applications of the list monad don&#39;t involve any I/O.  (Almost necessarily, since the standard ListT is actually broken but can&#39;t be fixed for backward compatibility reasons.)</div>
<div><br></div></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>