X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=exercises%2Fassignment3.mdwn;h=e0ecf97960782f7beded3b7144572791e63a772a;hp=b7371309eefc578e0ba16f25767c6594f11429ab;hb=f3df41e10d55cbd54cb83d405c7263686aafd6e6;hpb=a49f31f676a48aeb2926922636929d9c9db9be70 diff --git a/exercises/assignment3.mdwn b/exercises/assignment3.mdwn index b7371309..e0ecf979 100644 --- a/exercises/assignment3.mdwn +++ b/exercises/assignment3.mdwn @@ -8,7 +8,7 @@ 3. Using either Kapulet's or Haskell's list comprehension syntax, write an expression that transforms `[3, 1, 0, 2]` into `[3, 3, 3, 1, 2, 2]`. [[Here is a hint|assignment3 hint1]], if you need it. -4. Last week you defined `head` in terms of `fold_right`. Your solution should be straightforwardly translatable into one that uses our proposed right-fold encoding of lists in the Lambda Calculus. Now define `empty?` (It should require only small modifications to your solution for `head`.) +4. Last week you defined `head` in terms of `fold_right`. Your solution should be straightforwardly translatable into one that uses our proposed right-fold encoding of lists in the Lambda Calculus. Now define `empty?` in the Lambda Calculus. (It should require only small modifications to your solution for `head`.) 5. If we encode lists in terms of their *left*-folds, instead, `[a, b, c]` would be encoded as `\f z. f (f (f z a) b) c`. The empty list `[]` would still be encoded as `\f z. z`. What should `cons` be, for this encoding?