Skip to content

Instantly share code, notes, and snippets.

@vit0rr
Created November 27, 2022 02:07
Show Gist options
  • Save vit0rr/f3d88898abf6eb07f1afebf64896d8b5 to your computer and use it in GitHub Desktop.
Save vit0rr/f3d88898abf6eb07f1afebf64896d8b5 to your computer and use it in GitHub Desktop.
idk
let one = (f) => (x) => f(x) // (λf.λx.f x)
let two = (f) => (x) => f(f(x)) // (λf.λx.f (f x))
let _succ = (n) => (f) => (x) => f(n(f)(x)) // (λn.λf.λx.f (n f x))
let _add = (m) => (n) => (f) => (x) => m(f)(n(f)(x)) // (λm.λn.λf.λx.m f (n f x))
let _mult = (m) => (n) => (f) => (x) => m(n(f))(x) // (λm.λn.λf.λx.m (n f) x)
let _exp = (m) => (n) => (f) => (x) => n(m)(f)(x) // (λm.λn.λf.λx.n m f x)
let _pred = (n) => (f) => (x) => n((g) => (h) => h(g(f)))(u => x)(u => u) // (λn.λf.λx.n (λg.λh.h (g f)) (λu.x) (λu.u))
let _sub = (m) => (n) => n(_pred)(m) // (λm.λn.n pred m)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment