<br><font size=2 face="sans-serif">Hello,</font>
<br><tt><font size=2><br>
&gt; On 8/14/07, Jeff Polakow &lt;jeff.polakow@db.com&gt; wrote:<br>
&gt; &gt; One general intuition about monads is that they represent computations<br>
&gt; &gt; rather than simple (already computed) values:<br>
&gt; <br>
&gt; &gt; &nbsp; &nbsp; x :: Int &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; -- x is an Int<br>
&gt; &gt; &nbsp; &nbsp; x :: Monad m =&gt; m Int &nbsp;-- x is a computation
of an Int<br>
&gt; <br>
&gt; What's a &quot;computation&quot;? It seems to me that in a lazy language,
x::Int<br>
&gt; represents a computation of an int, not an &quot;already computed&quot;
value.<br>
&gt;</font></tt>
<br><tt><font size=2>This intuition for monads as &quot;computations&quot;
is independent of operational semantics.</font></tt>
<br>
<br><tt><font size=2>&gt; x::[Int] is a computation that returns multiple
values. x::(Int,Int)<br>
&gt; is a computation that returns a pair of values. x::() is a computation<br>
&gt; that returns nothing. x::Map a b is a computation that gives a way
to<br>
&gt; associate values of type a with values of type b. Some of these are<br>
&gt; monads, some are not. What's the difference between them? Why are
you<br>
&gt; calling certain values &quot;computations&quot;?<br>
&gt;</font></tt>
<br><tt><font size=2>Of course, the type [Int] denotes a value which is
a list of Ints; additionally [Int] can be viewed as a value representing
the nondeterministic computation of a single Int. Generally, the type Monad
m =&gt; m Int can be viewed as a value representing the computation of
an Int. However, I do not mean to imply that everything which can be viewed
as a computation of something is a monad. </font></tt>
<br>
<br><tt><font size=2>In any case, this is only meant to be a general (i.e.
high-level) intuition. BTW, this intuition was, more or less, the one used
by Moggi when describing how monads can be used to describe denotational
models for languages.</font></tt>
<br>
<br><tt><font size=2>-Jeff</font></tt>
<br>
<br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">---</span><br>
<br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">This e-mail may contain confidential and/or privileged information. If you </span><br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">are not the intended recipient (or have received this e-mail in error) </span><br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">please notify the sender immediately and destroy this e-mail. Any </span><br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">unauthorized copying, disclosure or distribution of the material in this </span><br>
<span style="font-family:sans-serif,helvetica; font-size:10pt; color:#000000">e-mail is strictly forbidden.</span><br>