Y combinator. Python lambda.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
|Y = lambda g: (lambda f: g(lambda arg: f(f)(arg))) (lambda f: g(lambda arg: f(f)(arg)))|
|if __name__ == "__main__":|
|fib = Y(lambda f: lambda n: (1 if n < 3 else f(n-1) + f(n-2)))|