<br><br><div class="gmail_quote">2009/2/5 Gregg Reynolds <span dir="ltr">&lt;<a href="mailto:dev@mobileink.com">dev@mobileink.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="gmail_quote">On Wed, Feb 4, 2009 at 8:18 PM, Richard O&#39;Keefe <span dir="ltr">&lt;<a href="mailto:ok@cs.otago.ac.nz" target="_blank">ok@cs.otago.ac.nz</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">

<div><br>
On 5 Feb 2009, at 10:20 am, Gregg Reynolds wrote:<br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
That&#39;s a fairly common representation, seems to work for lots of people, but it caused me no end of trouble. &nbsp;Values are mathematical objects; how, I asked myself, can they possibly /be/ programs that do IO (or actions, or computations, or &lt;your metaphor here&gt;)? &nbsp;It doesn&#39;t make sense, says I,<br>


</blockquote>
<br></div>
without reference to the rest of your message, of course values can /be/<br>
programs.</blockquote><div><br>Not &quot;programs&quot;, but &quot;programs that do IO&quot;.&nbsp; The point of the idiom is that there&#39;s an external side effect involved.&nbsp; What sticks in my craw is that &quot;a mathematical value with a non-mathematical side effect&quot; is, well, non-mathematical and possibly nonsensical.&nbsp; I know it works for some (most?) people, but for me it lacks Geometry and Theology.<br>

<br>-g<br></div></div><br></blockquote><div><br></div><div>I think the point of the Monad is that it works as a container of stuff, that still allows mathematically pure things to happen, while possibly having some opaque &quot;other stuff&quot; going on. &nbsp;If you have a monadic add operation, and a Monad of some kind that &quot;Contains an Integer&quot;, you can call the Monadic add operation on a pair of those monads, and some of the other monadic gluey-stuff that happens in between can combine the &quot;other stuff&quot; in specific ways, depending on how the Monad is defined. &nbsp;If it&#39;s &nbsp;the identity monad, it might not be that interesting, but if it&#39;s a writer monad, it might log things that are going on. &nbsp;m 1 + m 2 = m3, but what happened inside the &quot;m&quot; is entirely up to how that &quot;m&quot; is defined.</div>
<div><br></div><div>Does that make it a little easier to understand? &nbsp;IO could have happened in the &quot;m&quot;, but there&#39;s still a pure peace.... sometimes :-) &nbsp;(there&#39;s nothing stopping you reading an integer from the keyboard and returning it to totally break down that analogy I suppose).</div>
<div><br></div><div>At least this is how I like to think of Monads. &nbsp;If you want more guarantees about operations, keep them pure, and then you only have to really scrutinize the monad-using bits to see where your program can get screwy.</div>
<div><br></div><div>I realize that might not make the mathematician in you feel tons better, but *shrug*.</div><div><br></div><div>Dave</div><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<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>