X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=exercises%2Fassignment2_hint.mdwn;h=470740e35d26d9f900d9a012b111bb97e9a7a79a;hp=bd17bca1fd61af22b5f2573c09a6aefd6af120d2;hb=739888c429c1c16c40941d644cf218dd07f4fa27;hpb=d59368c87d38da086cbd84280987d9c69a47c567 diff --git a/exercises/assignment2_hint.mdwn b/exercises/assignment2_hint.mdwn index bd17bca1..470740e3 100644 --- a/exercises/assignment2_hint.mdwn +++ b/exercises/assignment2_hint.mdwn @@ -2,7 +2,7 @@ The problem was: 25. We mentioned in the Encoding notes that `fold_left (flipped_cons, []) xs` would give us the elements of `xs` but in the reverse order. So that's how we can express `reverse` in terms of `fold_left`. How would you express `reverse` in terms of `fold_right`? - This problem does have an elegant and concise solution, but it may be hard for you to figure it out. We think it will a useful exercise for you to try, anyway. We'll give a [[hint]]. Don't look at the hint until you've gotten really worked up about the problem. Before that, it probably will just be baffling. If your mind has really gotten its talons into the problem, though, the hint might be just what you need to break it open. + This problem does have an elegant and concise solution, but it may be hard for you to figure it out. We think it will a useful exercise for you to try, anyway. Don't look at the hint until you've gotten really worked up about the problem. Before that, it probably will just be baffling. If your mind has really gotten its talons into the problem, though, the hint might be just what you need to break it open. There are also other, less cool answers. Perhaps you'll find one of them first. @@ -30,3 +30,4 @@ And so on. That is the key to the solution. The questions you need to answer, to 5. So now put it all together, and explain how to express `reverse xs` using `fold_right` and primitive syntax like `lambda`, `&`, and `[]`? +The ideas in Chapter 8 of *The Little Schemer* may help you see the answer to this problem.