Skip to content

Instantly share code, notes, and snippets.

@vit0rr
Created November 27, 2022 02:07
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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