Representing Pairs and Lists in Lambda Calculus
Having covered types, let’s now turn our attention to lists. Lists are general purpose data structures for storing sequences of items. In lambda calculus, lists are represented using pairs, with the first item of the pair representing the head of the list, and the second item representing the rest of the list. A special value, nil, at as the second item of the pair terminates the list. Pairs Let’s start by focusing on pairs (or tuples). A pair is built from two arguments, \(a\) and \(b\), and returns a function \(f\) enclosing those two arguments: ...