Let's see analyse code for factorial in Haskell using lambda function:
y f x = f (y f) x
factorial = y (\t n -> if n == 1 then 1 else n * t(n-1))
And I cannot understand how does it works. I know that it is connected with lambda calculus but nowadays I am not familiar with that so I have to understand without it or with minimal knowledge. My doubt is: What is f in definition of factorial? I mean this f: y f x = f (y f) x.
So what is f here? y (\t n -> if n == 1 then 1 else n * t(n-1))
Please explain me that, maybe expand recursion?
n - 1.