Alligator Eggs Calculator
Examples
x
: An egg
λx.x
: Alligator and an egg
(λx.x) y
: An alligator eats an egg
(λx.x) (λy.y)
: Two alligators
(λx.λy. x) a b
: Take first
(λx.λy. y) a b
: Take second
(λx.x) ((λy.y) (λz.z))
: Old alligator
(λx.λy.x) (λy.y)
: Color rule
(λx.x x) (λx.x x)
: Omega (Mockingbird hears the Mockingbird song)
λg.(λx.g (x x)) (λx.g (x x))
: Y combinator
(λa.λs.λz.s (a s z)) (λs.λz.z)
: increment 0
(λa.λb.λs.λz.(a s (b s z))) (λs.λz.(s z)) (λs.λz.(s z))
: 1 + 1
(λa.λb.λs.λz.(a s (b s z))) (λs.λz.(s (s (s z)))) (λs.λz.(s (s (s (s z)))))
: 3 + 4
Share it! (iframe):
iframe source
(google gadget)
gadget source
The source code is
here
. The idea is from
Bret Victor's "Alligator Eggs!"