Hi Daryoush,<br><br><div class="gmail_quote">2009/2/13 Daryoush Mehrtash <span dir="ltr">&lt;<a href="mailto:dmehrtash@gmail.com">dmehrtash@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I have been trying to figure out the distinction between value, function and computation.&nbsp;&nbsp;&nbsp;&nbsp; You raised a few points that I am not sure about.<br><br><br>In &quot;
                                        &quot;Computation&quot; considered harmful. &quot;Value&quot; not so hot either.&quot; you said:<br><br><div style="margin-left: 40px;">I still don&#39;t like it; a lambda expression is not a computation, it&#39;s a formal <i>representation</i> of a mathematical object (a <i>value</i>).<br>

</div><br><br>Isn&#39;t the lambda expression a representation of&nbsp; something (potentially with recursion) that yields &quot;a value&quot; and not the value itself?&nbsp;&nbsp; Even integer which we think of as values are represented in the same way:&nbsp; <a href="http://safalra.com/science/lambda-calculus/integer-arithmetic/" target="_blank">http://safalra.com/science/lambda-calculus/integer-arithmetic/</a><br>

</blockquote><div><br>Excellent question, and it illustrates the problem of &quot;abstraction management&quot; very nicely.&nbsp; The way Church presented the lambda operator in &quot;Introduction to Mathematical Logic&quot; is very instructive.&nbsp; The basic idea was how to avoid having to name functions.&nbsp; This is a very pragmatic concern; if we didn&#39;t have the lambda operator, we would have to invent a name for every function we want to discuss, which would quickly lead to unmanageable clutter for both writer and reader.&nbsp; Church put it in terms like this:&nbsp; &quot;x + 2&quot; is a formula, but it doesn&#39;t denote anything, since x is free.&nbsp; It&#39;s not completely devoid of meaning - we get the &quot;+ 2&quot; part - but it&#39;s an &quot;open sentence&quot;: not a function, not a value (or: not the name of a function or value).&nbsp; But there is a function /associated/ with the formula; we can denote that function, but only by introducing a name: f x = x + 2.&nbsp; Now f denotes the function associated with the formula.&nbsp; Which means we have two things: syntax, and semantics.&nbsp; Actually three things, since the name f is a thing.&nbsp; The lambda operator just allows us to do the same thing without names:&nbsp; the expression &quot;lambda x.x+2&quot; denotes the function associated with the form x + 2.<br>
<br>So a lambda abstraction expression denotes a function without naming it.&nbsp; IOW, the function is not the formula; it is an abstract mathematical thing.&nbsp; A lambda application expression - e.g. (\x -&gt; x + 2)3 denotes application of the function to an argument.&nbsp; Here &#39;3&#39; names a &quot;value&quot;; but the value and the name are distinct.&nbsp; Lambda calculus thinks of function application in terms of rewriting forms - it&#39;s a calculus, it just manipulates the symbolic forms.&nbsp; In other words, the fact that \x -&gt; x + 2 and 3 denote values isn&#39;t important; we say the application denotes 5 because of syntactic rules.&nbsp; 5 is just a symbol that replaces the application expression.<br>
<br>The contrast with ZF set theory helps.&nbsp; In a set theoretic account, functions are just sets of ordered pairs.&nbsp; Application just projects the second element of the function pair whose first element is equal to the argument.&nbsp; The notion of algorithm or computation is totally absent; that&#39;s why ZF is so attractive for semantics.&nbsp; We only want to know what an expression means, not how its meaning was discovererd.<br>
<br>So even though lambda calculus may used to describe the symbolic manipulations needed to find the value of an application, it is not accurate to say that a lambda expression represents a computation or something that yields a value, as you put it.&nbsp; Or at any rate that it /only/ represents a computation.&nbsp; It is entirely legitimate to say that &quot;(\x -&gt; x+2)3&quot; denotes 5 (or more accurately, the value represented by the symbol &#39;5&#39;); that represents the set theoretic perspective.&nbsp; But lambda calculus licenses us the think of the same expression as a representation of the reduction chain leading to the symbol &#39;5&#39;.&nbsp; So it really depends on your perspective.<br>
&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>In &quot;
                                        Fixing Haskell IO&quot; you say:<br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">This &quot;works&quot; well enough; GHC manages to perform IO. But it doesn&#39;t fly mathematically. Mathematical objects <i>never</i> act, sing, dance, or <i>do</i> anything. They just are. A value that acts is an oxymoron.<br>

</blockquote><br><br>I guess I am not sure what a &quot;mathematical object&quot; is. &nbsp; Do you consider Newton method a mathematical object?&nbsp;&nbsp; What would be the &quot;value&quot; :&nbsp; <a href="http://en.wikipedia.org/wiki/Newton%27s_method#Square_root_of_a_number" target="_blank">http://en.wikipedia.org/wiki/Newton&#39;s_method#Square_root_of_a_number</a><br>

</blockquote><div><br>Again, it all depends on perspective.&nbsp; A formal method can be considered a mathematical object: a sequence.&nbsp; Just like a lambda expression, viewed as a representation of a sequence of reductions.&nbsp; But here again, the representation and the thing represented are not the same.&nbsp; Newton&#39;s method is an algorithm, which exists independently of any particular representation, just like the integer &quot;three&quot; is independent of the symbolic conventions we use to denote it. &nbsp; So Newton&#39;s method can be considered a value, just as an algorithm is a kind of value, in the abstract.&nbsp; And the function &quot;sqrt&quot; can be considered a value, independent of any algorithm.&nbsp; Application of Newton&#39;s method - note I said &quot;application&quot;, not &quot;syntactic representation of application&quot; can be thought of as a value, or an algorithmic process, or a piece of syntax, etc.&nbsp; A syntactic representation if application can be considered to denote the &quot;final&quot; value, or the process of computing the value, etc. It all depends on your perspective.<br>
<br>This is a very tricky problem, but it&#39;s a writing problem, not a technical problem, which is what makes it fun for a writer.<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Since I have been thinking about Haskell, Monads, etc. I am starting to think about the&nbsp; saying &quot;Life is a journey, not a destination&quot; to imply life is a computation not a value.&nbsp; <br></blockquote><div><br>Very nice.&nbsp; I propose that &quot;Life is a computation, not a value&quot; or some variant be adopted as the official haskell slogan.&nbsp; Or maybe something like:&nbsp; &quot;Haskell ... because there&#39;s more to life than values&quot;.<br>
<br>Hope that helps.<br><br>-gregg <br></div></div><br>