Review for Quiz 4

One-page version suitable for printing.

Question 4-1

Using the Church numerals, we can define the inc function in the lambda calculus to take a Church numeral representing some number n and return the Church numeral representing n+1.

inc = λasz.a s (s z)
Give a lambda calculus definition of the addition function +, which takes two Church numerals representing two numbers m and n and returns a Church numeral representing their sum, m+n.

Solution

Question 4-2

Define class as it relates to the Haskell programming language.

Solution

Question 4-3

Describe what shows function does - that is, what parameters does the function take, and what does it return?

Solution