Lambda Calculus is an inspiring idea, but most of the resources about it list just a couple of utilities and ways to encode data, without getting deep enough into building a practical set of primitives. ~stdlambda~ tries to do just that: provide a more or less practical set of primitives for programming in Lambda Calculus. Included are:
Sources of inspiration and code:
[[http://www.golfscript.com/lam/][Universal Lambda page]].
Justine Tunney's [[https://justine.lol/lambda/][SectorLambda page]].
Hikaru Ikuta's [[https://github.com/woodrush/lambdacraft][Lambdacraft]]
Getting Started
Feed the definitions from provided files into your Lambda Calculus interpreter. The files (and their interdependencies) are:
Run the code using these primitives. Say
fac = Y λr.λn.(if (=0 n) 1 (× n (r (1- n)))) (fac 5)
Format The format is the single-letter single-argument lambdas. The approximate regex would be:
. = (λ[a-z].).*
Not all function applications are enclosed into parentheses and not all applications are single-argument. Example:
first = compose car (0 cdr)
and not
first = ((compose car) (0 cdr))
It's too much work to maintain such a code. I might reconsider that in the future, though.
Acknowledgements
Many logical combinators come from [[https://wiki.xxiivv.com/site/logic][Devine Lu Linvega logic page]].
Lists (and ~foldr~ especially) come from the [[http://www.golfscript.com/lam/][Golfscript Universal Lambda page]].
Many list primitives and names for things come from Common Lisp and Scheme.