Created
July 28, 2021 19:00
-
-
Save palladin/d5f0a5cef2773afdf1a161207764feee to your computer and use it in GitHub Desktop.
Know thyself
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
let fact = `(f => n => (n === 0) ? 1 : n * f(n - 1))` | |
function Y(g : string) : (any) => any { | |
let f = `(f => ${g}(x => eval(f)(f)(x)))` | |
return eval(f)(f) | |
} | |
console.log(Y(fact)(10)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment