This is my implementations of the Y-Combinator in different programming languages. The Y-Combinator is a way to make recursive functions in programming languages which does not support it. It was discovered by Haskell B. Curry and defined using Lambda Calculus.
I learned about the Y-combinator when watching the Computerphile video about the Wikipedia after watching their video about Lambda Calculus.. I did not quite understand it at first. Therefore I decided to try and implement it to get a better understand it
My implementations except for in Haskell
is the Z-Combinator, which is the Y-Combinator for eager evaluating languages. This prevents infinte loops by wrapping the inner function in another lambda.
- Javascript
- Elisp
- Python
- Scheme
- Java
- Ruby
- Haskell
- Erlang
- Elixir
Good places to learn more about the Y-Combinator: