Read the blog post that accompanies this project here.
To build, just run odin run build.
-
./lambda-calculusRun the REPL -
./lambda-calculus -i std.lcImportstd.lcand run the REPL -
./lambda-calculus examples/insertion_sort.lcEvaluateinsertion_sort.lc
Insertion sort over a list of Church numerals:
let insert = Y (\go. \n. \l.
if (nil? l)
(cons n nil)
(if (lte? n (head l))
(cons n l)
(cons (head l) (go n (tail l)))))
let sort = Y (\go. \l.
if (nil? l)
nil
(insert (head l) (go (tail l))))
let sorted = sort (cons three (cons two (cons five (cons four nil))))