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=2f9ea958a1eb9d82d6f8dcad14e9060aeeaf9e4b;hpb=07ebc9292a8db8b98707232d2d01717293f473e9;ds=sidebyside 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: