X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=exercises%2Fassignment3.mdwn;h=e0ecf97960782f7beded3b7144572791e63a772a;hp=f80fe71c355912c10431fde30ba34c20571ac691;hb=e14a493f3df7e2e501265518ffa3a6b70a88ca1c;hpb=718358bbaf75c965308de98e0bd527242e37855a diff --git a/exercises/assignment3.mdwn b/exercises/assignment3.mdwn index f80fe71c..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 the Lambda Calculus, using our proposed encoding for lists. 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?