Assignment 3 ------------ Once again, the lambda evaluator will make working through this assignment much faster and more secure. *Writing recursive functions on version 1 style lists* Recall that version 1 style lists are constructed like this:
let true = \x y. x in
let false = \x y. y in
let makePair = \f s g. g f s in
let nil = makePair true meh in
let makeList = \h t. makePair false (makePair h t) in
let mylist = makeList 1 (makeList 2 (makeList 3 nil)) in
let fst = true in
let snd = false in
let isNil = \x. x fst in
let head = \l. isNil l err (l snd fst) in
let tail = \l. isNil l err (l snd snd) in
let succ = \n s z. s (n s z) in
let Y = \f. (\h. f (h h)) (\h. f (h h)) in
let length = Y (\length l. isNil l 0 (succ (length (tail l)))) in

length mylist
Then `length mylist` evaluates to 3. What does `head (tail (tail mylist))` evaluate to?