-
-
Save MikuroXina/f1a1f1d1b1bdacac4da622e70d57ddcc to your computer and use it in GitHub Desktop.
Y fixed combinator with TypeScript.
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
export type Paradoxical<A, R> = (f: Paradoxical<A, R>) => (a: A) => R; | |
export const Y = <A, R>(f: (g: (a: A) => R) => (a: A) => R): ((a: A) => R) => | |
((x: Paradoxical<A, R>) => f((lazy) => x(x)(lazy)))( | |
(x: Paradoxical<A, R>) => f((lazy) => x(x)(lazy)), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment