X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=exercises%2Fassignment3_answers.mdwn;h=082cb77e029ef53bcea93d1223aded2b96ec9585;hp=92da0884b1f1499529f45ed13fb69751d346b2d5;hb=442a8534983a824eec968ce2bb113fe60e0b1007;hpb=1200c12754fb2b57a0bd3008c1fa785016f1bb82 diff --git a/exercises/assignment3_answers.mdwn b/exercises/assignment3_answers.mdwn index 92da0884..082cb77e 100644 --- a/exercises/assignment3_answers.mdwn +++ b/exercises/assignment3_answers.mdwn @@ -57,7 +57,7 @@ > I'm not sure which of the two solutions presented here is better. The one given in the hint traverses the list only once; whereas the one gotten by reversing the list and getting the last member of the result traverses the list twice. But the former strategy does more complicated stuff at each step of the traversal (both conceptually and more applications), so in the end it might be computationally "cheaper" to use the latter strategy. - > Here is yet a third solution: + > Here is yet a third solution, which is probably the most efficient: > let box = \a. \v. v a in > let left_head = \xs. xs (\b x. (K (b (K x)))) (box err) I in @@ -121,7 +121,7 @@ > let pred = \n. n shift (pair 0 err) snd in > ... - > Here is another solution, due to Martin Bunder and F. Urbanek: + > Here is another solution, that is attributed variously to Martin Bunder and F. Urbanek, or J. Velmans: > let box = \a. \v. v a in > let pred = \n. \s z. n (\b. box (b s)) (K z) I in