Last active
October 20, 2022 18:09
-
-
Save hansoksendahl/993451f8739eff8f1b5f83f26501c953 to your computer and use it in GitHub Desktop.
SKI Combinators Typescript
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
type S = <A, B, C>(abc: (a: A) => (b: B) => C) => (ab: (a: A) => B) => (a: A) => C | |
type K = <A>(a: A) => <B>(b: B) => A | |
/** λx.λy.λz.xz(yz) */ | |
const s: S = a => b => c => a(c)(b(c)) | |
/** λx.λy.x */ | |
const k: K = a => b => a | |
/** λx.x */ | |
const i = s(k)(k) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment