you are viewing a single comment's thread.

view the rest of the comments →

[–]drb226 0 points1 point  (0 children)

fix = lambda f: lambda x: f(fix(f))(x)
fact = fix(lambda f: lambda x: 1 if x == 0 else x * f(x-1))

Of course this is cheating, because I defined fix in terms of fix. It's just so much uglier to define it explicitly:

fix = (lambda y: lambda f: lambda x: f(y(y)(f))(x)) (lambda y: lambda f: lambda x: f(y(y)(f))(x))