Lists

Lists and list operators are usually "built in" with programming languages based on λ-calculus but they can be defined in λ-calculus. The following example shows a way to define CONS, NIL, HD (head), TL (tail), and NULL. (PRINT is a cheat because it is defined using the system's built-in lists ('::'), but it too could be defined in λ-calculus.)




There are more λ-calculus examples here.