f(x) = x + 2 h(x, y) = x + 5 y
But even without defining the machinery of these functions, we can easily talk about their composition. For example:
1. h(x, y) . f(x) . f(x) . h(x, y) or 2. h . f . f . h
We can include the arguments if we want, or we can abstract away completely to give an overview of what’s happening. And we can quickly reduce them to a single function. Let’s look at composition 2. I can have student layers of detail I can write with depending on my emphasis:
g = h . f . f . h g(x, y) = h(x, y) . f(x) . f(x) . h(x, y) g(x, y) = h . f . f . h = x + 10 y + 4
Let’s perform the above with lambda calculus, or at least define the functions. I’m not sure this is right, but I believe the first and second expressions increment by 2.
(λuv.u(u(uv)))(λwyx.y(wyx))x
And to multiply by 5y.
(λz.y(5z))
Rather than be abstract, this seems to get into the very machinery of what it means to add, multiply, etc. Abstraction, in my mind, means higher level rather than lower level. Furthermore, I am struggling to see why lambda calculus is even a thing. What is the advantage of
(λuv.u(u(uv)))(λwyx.y(wyx))x
over
h(x) = x + 5 y
or a combined notation
Hxy.x+5y
or even Haskell’s notation
h x y = x + 5 * y
Again, what does lambda calculus do for us that we can’t do with the f(x)-style function properties and notation many are familiar with.
Asked By : JDG
Answered By : Hans Hüttel
Best Answer from StackOverflow
Question Source : http://cs.stackexchange.com/questions/66849