The Y Combinator
mvanier.livejournal.com
The Y Combinator
1–10 of 39 posts
Re: The Y Combinator
#2Re: The Y Combinator
#3Re: The Y Combinator
#4Curiously, the graphical lambda calculus notation for the Y combinator slightly resembles a Y, especially when bent a little as shown at the top of https://tromp.github.io/cl/diagrams.html
Re: The Y Combinator
#5Curiously, the graphical lambda calculus notation for the Y combinator slightly resembles a Y, especially when bent a little as shown at the top of https://tromp.github.io/cl/diagrams.html
Then they resemble a λ.
Re: The Y Combinator
#6Curiously, the graphical lambda calculus notation for the Y combinator slightly resembles a Y, especially when bent a little as shown at the top of https://tromp.github.io/cl/diagrams.html
I always assumed that's where it got the same from?
How did the fixed point combinator come to be known as the Y combinator?
Re: The Y Combinator
#7Re: The Y Combinator
#8 factorial' self n =
if n == 0
then 1
else n * self self (n - 1)
factorial n = factorial' factorial' n
That's it. Unless your evaluation strategy is literally implemented as term substitution/rewriting, it's about as efficient as having actual letrec primitive.This technique is straightforwardly extended to the case of mutual recursion:
even' even odd n =
if n == 0
then True
else odd even odd (n - 1)
odd' even odd n =
if n == 0
then False
else even even odd (n - 1)
even n = even' even' odd' n
odd n = odd' even' odd' nRe: The Y Combinator
#9Earlier quoted context omitted.
I always assumed that's where it got the same from?
The name Y combinator is many decades old, while this graphical notation is not even one decade old. But you do raise an interesting question: How did the fixed point combinator come to be known as the Y combinator?
It's like the question: why do we use "x" to denote the unknown value in mathematics, most of the time?
Re: The Y Combinator
#10Earlier quoted context omitted.
The name Y combinator is many decades old, while this graphical notation is not even one decade old. But you do raise an interesting question: How did the fixed point combinator come to be known as the Y combinator?
Probably just drawing letters from the alphabet. It's like the question: why do we use "x" to denote the unknown value in mathematics, most of the time?
[1] https://www.johndcook.com/blog/2014/02/06/schonfinkel-combin...