Skip to content

Instantly share code, notes, and snippets.

@pepsin
Created December 12, 2015 12:29
Show Gist options
  • Save pepsin/616f7d92bc3a79cd6c64 to your computer and use it in GitHub Desktop.
Save pepsin/616f7d92bc3a79cd6c64 to your computer and use it in GitHub Desktop.
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