EECS 762

Programming Language Foundation I

Index
Blog

Homework 2

Problems

  1. Using the Y-combinator and Church encodings for pairs to define a lists encoding that includes cons, first, and rest.
  2. Using your lists encoding define a map operator that applies a function to every element of a list and returns the result.
  3. Using your lists encoding define a search operator that searches a list of natural numbers for a value and returns it.
  4. Using your lists encodings create a list [1,2,3] and calculate the result of mapping an increment function over the list
  5. Using your lists encodings create a list [1,2,3] and calculate the result of searching for 2.
  6. Using your lists encodings create a list [1,2,3] and calculate the result of searching for 4.

Hints