From 4848a46f667584a05580415f26a8f42b522cc040 Mon Sep 17 00:00:00 2001 From: jim Date: Mon, 23 Feb 2015 11:59:46 -0500 Subject: [PATCH] add --- exercises/assignment2_answers.mdwn | 1 + 1 file changed, 1 insertion(+) diff --git a/exercises/assignment2_answers.mdwn b/exercises/assignment2_answers.mdwn index 6d0e5aa4..04c103c4 100644 --- a/exercises/assignment2_answers.mdwn +++ b/exercises/assignment2_answers.mdwn @@ -199,6 +199,7 @@ Folds and Lists reverse xs = fold_right (f, []) xs in reverse + *Here is an elegant, efficient answer following the [[hint|assignment2 hint]]* Suppose the list we want to reverse is `[10, 20, 30]`. Applying `fold_right` to this will begin by computing `f (30, z)` for some `f` and `z` that we specify. If we made the result of that be something like `30 & blah`, or any larger structure that contained something of that form, it's not clear how we could, using just the resources of `fold_right`, reach down into that structure and replace the `blah` with some other element, as we'd evidently need to, since after the next step we should get `30 & (20 & blah)`. What we'd like instead is something like this: -- 2.11.0