Created
December 7, 2017 19:42
-
-
Save colbydauph/8392aaefdb2a820fddad69f37ae52444 to your computer and use it in GitHub Desktop.
Y Combinator
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
// const factorial = Y(f => n => n > 1 ? n * f(n - 1) : 1); | |
const Y = f => (x => x(x))(y => f(x => y(y)(x))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment