4 ms·
It's not useful in practice. But defining recursion via a function is a good mental exercise. I'm unaware of compilers using the Y combinator. Perhaps you we
by billsix 8y ago
It's not useful in practice. But defining recursion via a function is a good mental exercise.
I'm unaware of compilers using the Y combinator. Perhaps you were thinking of continuation passing style
- amelius 8y agoI believe Simon Peyton Jones has a chapter on combinators in his compiler book, but I don't think they are being used in the final proposed solution.
- taneq 8y agoFunctional programming: Making you feel clever by allowing you to solve problems that nobody else even knew existed, in order to let you do what everyone else could do from the start.
- billsix 8y agoDiscussion of the Y Combinator on news.ycombinator.com should not be derided.
- smadge 8y agoI’m not sure about it actually being used in compilers. However as I understand it the simply typed lambda calculus does not support recursive functions. If you want a typed functional language you have to introduce as a primitive a recursive combinatory like fix or the Y combinator.