2009/4/9 Mark Spezzano <span dir="ltr">&lt;<a href="mailto:mark.spezzano@chariot.net.au">mark.spezzano@chariot.net.au</a>&gt;</span>












<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div link="blue" vlink="purple" lang="EN-AU"><div><p>Or does RT ignore the encapsulated data and just view the “action”
performed by the monad as the “value” of the monad?</p></div></div></blockquote><div><br>If I understand you right, this is more-or-less correct.<br><br>You may as well think of IO as some sort of algebraic type that you are building and returning.  A value of type &quot;IO Integer&quot; is not, itself, an integer.  Thus:<br>
<br>main =<br>  let r = print &quot;hello&quot;<br>  in return ()<br><br>Prints nothing.  RT steps in in a similar scenario:<br><br>main =<br>  let r = print &quot;hello&quot;<br>  in do { r; r }<br><br>Replacing &quot;r&quot; with its definition:<br>
<br>main = do { print &quot;hello&quot;; print &quot;hello&quot; }<br><br>As expected.<br><br>Luke<br><br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-AU"><div><p></p>

<p> </p>

<p>Just curious as to the rationale behind referential
transparency and how it applies to monads.</p>

<p> </p>

<p>Cheers,</p>

<p> </p>

<p>Mark Spezzano</p>

<p> </p>

</div>

</div>


<br>

<p><font size="2">No virus found in this outgoing message.<br>
Checked by AVG.<br>
Version: 7.5.557 / Virus Database: 270.11.48/2048 - Release Date: 8/04/2009 7:02 PM<br>
</font> </p>
<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>