X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=topics%2Fweek3_lists.mdwn;h=bea4c5b26a5ba4bae95b75fbcd0d24d8b3846695;hp=ac4e0f4ef5d731cfa8f23f402d3c1a46cbdd634b;hb=ee740cb01fb82eabad1dc1d044900b3f20731793;hpb=d7a978d7e10a32f675fa3b98f21b2a8c32c34c1e diff --git a/topics/week3_lists.mdwn b/topics/week3_lists.mdwn index ac4e0f4e..bea4c5b2 100644 --- a/topics/week3_lists.mdwn +++ b/topics/week3_lists.mdwn @@ -174,7 +174,7 @@ or in other words: The difference is that this new encoding uses a fold function `g` expecting *three* arguments, and the encoding not only passes the current head as a first argument to that function (as before), but *also* passes the current tail as a new middle argument to that function. As before, we continue to pass the result of the fold *applied to* the tail as the last argument. -With this encoding scheme, each list would be represented by a somewhat more complex function than before. On the other hand, it would now become as easy to query the list's tail as it is to query its head. +With this encoding scheme, each list would be represented by a somewhat more complex function than before. On the other hand, it would now become as easy to query the list's tail as it is to query its head. Before the refinement, querying the tail of a list required us to *build up* the tail afresh each time we wanted to extract it. Whereas this refinement *saves a copy* of the tail *for direct access*, as a new middle argument to the fold function, when the list is first constructed. (Oleg discusses making a parallel refinement in the encoding of numbers [here](http://okmij.org/ftp/Computation/lambda-calc.html#p-numerals).)