X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=exercises%2Fassignment3_hint2.mdwn;h=9821f057b7b76fa532ad3c183143903cda609db0;hp=2efd11d2f366af319fb668ee6b085006330b048c;hb=2e29b34f4aaeb85ead4685541bd52557ef4297e2;hpb=b793674656fb3fd94b64124573eeb16a40071c03 diff --git a/exercises/assignment3_hint2.mdwn b/exercises/assignment3_hint2.mdwn index 2efd11d2..9821f057 100644 --- a/exercises/assignment3_hint2.mdwn +++ b/exercises/assignment3_hint2.mdwn @@ -1,4 +1,4 @@ -## Lists +## Lists and List Comprehensions 7. Continuing to encode lists in terms of their left-folds, how should we write `head`? This is challenging. @@ -19,7 +19,7 @@ That's what `m a` should be, so `m` should be `\a. \n b. n a`. And if we check: `(\n b. n a) (\a. \n b. n a) b ~~>` `(\b. (\a. \n b. n a) a) b ~~>` `(\b. (\n b. n a)) b ~~>` -`(\n b. n a)` ≡ +`(\n b. n a) <~~>` `m a` Looks good. So `f` needs to be a function that accepts an argument `w` (after the first stage, this will be `m a`), and an argument `b`, and applies `w` to `m` and to `b`. In other words, `f` should be: