Visualize λ
7.2

Visualize λ

Code: visualize-λ

Bound variables are displayed as circles. And variable use are displayed as disks. @ means application.

Omega combinatior

(λ (x) (x x))

image

Y combinator

(λ (f) ((λ (x) (f (x x))) (λ (x) (f (x x)))))

image

Z combinator

(λ (f) ((λ (x) (f (λ (v) ((x x) v)))) (λ (x) (f (λ (v) ((x x) v))))))

image

Plus in Church encoding

(λ (m) (λ (n) (λ (f) (λ (x) ((m f) ((n f) x))))))

image