n***@gmail.com
2012-07-15 13:17:19 UTC
I was reading/reminded that 'lambda calculus is not easy'.
So I a got-out my copy of
http://en.wikipedia.org/wiki/Lambda_calculus
But I can't afford the effort to learn how to edit wikis.
So I'll put it here:- [my wiki contaminated by my 'comments']
Intuitive means related to concrete/familiar life.
Eg. take a 3D/volume: semi-sphere, rect-cube or a 'wedge' is
interesting; and place it on your x-y-coordinate 'pad'.
The task/function is to know the <heights above your x-y-pad>
of the top-surface. Like the heights of a mountain at a specific
longtitude, latitude.
For the wedge: if you know the x-value and the the y-value
is constant at THAT x-value, you've got the answer.
For the mountain: if you can only buy services of a flying-saucer
that gives the longtitude-to-terain-height-function for a FIXED
latitude, you've got the height, from you single parameter.
So the set of (x,y) tuples & f1 is collaped into an eqivalent:
[say] (x, y-cuts/slices/function) .
By induction, it extends to N-dimensions.
Here's a very intuitive example:
the fare for transport is quoted in a table, as being a function of
'route' and class. Where route means 'A to B' equals 'B to A'.
So 'Albany to Boston', class:2 costs $7,
and 'Boston to Albany', class:1 costs $9.
If you want to know the fare from 'Albany to Cooktown', class:3,
you don't need to provide both paramenters: 'route' and class.
You can just give the route, and ask for the singleton-function
[list of all prices for 'Albany to Cooktown' for all classes].
Thanks, I think I understand currying better now.
Do you?
== Chris Glur.
PS. explanations that I have of 'monads' are disasterous.
So I a got-out my copy of
http://en.wikipedia.org/wiki/Lambda_calculus
But I can't afford the effort to learn how to edit wikis.
So I'll put it here:- [my wiki contaminated by my 'comments']
Currying may best grasped intuitively through the use of an
example. Compare the function (x, y) | x*x + y*y with its curried
((x, y) | x*x + y*y)(5, 2) = 5*5 + 2*2 = 29. <-- f(5, 2) = 29
((x | (y | x*x + y*y))(5)) (2) <--- (functn) (arg)
(<1 arg> maps-to <lambda1Funct> (5) ) (2)
= (y | 5*5 + y*y) (2)
= 5*5 + 2*2 = 29 <----------------- * !!
and we see the uncurried and curried forms compute the same result.
So what? That's not an intuitive explanation.example. Compare the function (x, y) | x*x + y*y with its curried
((x, y) | x*x + y*y)(5, 2) = 5*5 + 2*2 = 29. <-- f(5, 2) = 29
((x | (y | x*x + y*y))(5)) (2) <--- (functn) (arg)
(<1 arg> maps-to <lambda1Funct> (5) ) (2)
= (y | 5*5 + y*y) (2)
= 5*5 + 2*2 = 29 <----------------- * !!
and we see the uncurried and curried forms compute the same result.
Intuitive means related to concrete/familiar life.
Eg. take a 3D/volume: semi-sphere, rect-cube or a 'wedge' is
interesting; and place it on your x-y-coordinate 'pad'.
The task/function is to know the <heights above your x-y-pad>
of the top-surface. Like the heights of a mountain at a specific
longtitude, latitude.
For the wedge: if you know the x-value and the the y-value
is constant at THAT x-value, you've got the answer.
For the mountain: if you can only buy services of a flying-saucer
that gives the longtitude-to-terain-height-function for a FIXED
latitude, you've got the height, from you single parameter.
So the set of (x,y) tuples & f1 is collaped into an eqivalent:
[say] (x, y-cuts/slices/function) .
By induction, it extends to N-dimensions.
Here's a very intuitive example:
the fare for transport is quoted in a table, as being a function of
'route' and class. Where route means 'A to B' equals 'B to A'.
So 'Albany to Boston', class:2 costs $7,
and 'Boston to Albany', class:1 costs $9.
If you want to know the fare from 'Albany to Cooktown', class:3,
you don't need to provide both paramenters: 'route' and class.
You can just give the route, and ask for the singleton-function
[list of all prices for 'Albany to Cooktown' for all classes].
Thanks, I think I understand currying better now.
Do you?
== Chris Glur.
PS. explanations that I have of 'monads' are disasterous.