You don't normally call x::Int a computation of an Int because there's nothing that distinguishes the value of the x from what it was before you computed it. So I prefer to regard x as a value (in a domain, of course). But for x :: (Monad m) => m Int there is something else happening, so the word computation makes sense.
<br>This is just the terminology people use, not an absolute truth, so you're free to think it's wrong. :)<br>BTW, if you regard non-termination as an effect then even x :: Int is a computation.<br><br> -- Lennart
<br><br><div><span class="gmail_quote">On 8/14/07, <b class="gmail_sendername">Dan Piponi</b> <<a href="mailto:firstname.lastname@example.org">email@example.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 8/14/07, Jeff Polakow <<a href="mailto:firstname.lastname@example.org">email@example.com</a>> wrote:<br>> One general intuition about monads is that they represent computations<br>> rather than simple (already computed) values:
<br><br>> x :: Int -- x is an Int<br>> x :: Monad m => m Int -- x is a computation of an Int<br><br>What's a "computation"? It seems to me that in a lazy language, x::Int<br>represents a computation of an int, not an "already computed" value.
<br>x::[Int] is a computation that returns multiple values. x::(Int,Int)<br>is a computation that returns a pair of values. x::() is a computation<br>that returns nothing. x::Map a b is a computation that gives a way to<br>
associate values of type a with values of type b. Some of these are<br>monads, some are not. What's the difference between them? Why are you<br>calling certain values "computations"?<br>--<br>Dan<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">http://www.haskell.org/mailman/listinfo/haskell-cafe