-
-
Save pepsin/616f7d92bc3a79cd6c64 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 = function(lep) { | |
return (function (f) { | |
return f(f); | |
})(function(f){ | |
return lep(function(x){ | |
return f(f)(x); | |
}); | |
}); | |
} | |
function fib(f) { | |
return function(n) { | |
return n === 0 ? 1 : n * f(n-1); | |
}; | |
} | |
console.log(Y(fib)(10)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment