4 ms·
Are there answers to the exercises? I'm kind of stuck on 3b in section 8. Should I evaluate from right to left - normalize 'y' lambda given a y-value of 5? The
by monkpit 10y ago
Are there answers to the exercises? I'm kind of stuck on 3b in section 8. Should I evaluate from right to left - normalize 'y' lambda given a y-value of 5?
Then, in that case, there is only one argument (const 10) to pass to the 'fx' lambda and I guess you end up with a partial or something?
Or should the 'y' lambda and the constant 5 be considered the 2 parameters passed to the 'fx' lambda? In which case I guess the answer comes to be const 20?
- icen 10y agoλ calculus is left associative - that is, a sequence of applications A B C is interpreted as (A B) C, so we first reduce (λf x. f (f x)) (λy.* 2 y), yielding λx . (λy. * 2 y) ((λy.2 * y) x), and only then apply 5 to it, which finally lets us unravel everything and get 20.
- tromp 10y ago> I'm kind of stuck on 3b in section 8. So you managed to do exercise 8.7 ? I wonder if there is an answer shorter than 22 symbols... Nice instance of lambda golfing!
- monkpit 10y agoNo, because I got stuck on question 3 :) Also, I find questions like 8.7 to be really uninteresting - it seems like busywork.