Instantly share code, notes, and snippets.

Embed
What would you like to do?
Lambda Fibonacci
;; Credit Eli Barzilay
(λ(f)(λ
(x)(((x(λ(
x)(λ(x y)y)
)(λ(x y)x))(
x(λ(x)(λ(x y)
y))(λ(x y
)x))(((
x(λ(p)(
λ(s)(s
(p (λ(
x y)y))
(λ(f x
)(f((p(
λ(x y)
y))f x
))))))(
λ(s)(s(
λ(f x)x)
(λ(f x)x)
)))(λ(x y)
x))(λ(x)(λ(
x y)y)) (λ(
x y) x)))(λ(
f x)(f x))((f
((x(λ(p )(λ (s
)(s(p( λ(x y)
y))(λ ( f x)(f(
(p (λ( x y)y)
)f x))) )))(λ(
y s)(s (λ (f x
)x)(λ( f x)x)
)))(λ( x y)x))
)(λ(n) (λ (f
x)(f (n f x)))
)(f((( (x(λ(p)
(λ(s)(s (p( λ(
x y )y ))(λ(f
x) (f(( p(λ(x y
)y)) f x)))))
)(λ(s)( s(λ(f x
)x)(λ( f x)x)
))) (λ (x y)x
))(λ(p )(λ(s)(
s(p(λ( x y)y)
)(λ (f x)(f((
p(λ (x y)y)) f
x)))))) (λ(s)(
s(λ (f x)x)(λ
(f x)x) )))(λ(
x y)x) ))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment