X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=week4.mdwn;h=362ad66cc5574d308df3431fb7f74529388c9419;hp=58bd7473e499d883069786a9dac040c88316a01c;hb=48b6ae024e8268541a5b6be4d87f4894e357e4a1;hpb=2195d0c1fa3c064c7090ac25a95cc61ae67bf616 diff --git a/week4.mdwn b/week4.mdwn index 58bd7473..362ad66c 100644 --- a/week4.mdwn +++ b/week4.mdwn @@ -593,17 +593,17 @@ detail](http://okmij.org/ftp/Streams.html#enumerator-stream). > We could improve this by building lists as left folds when implementing them > as continuation-passing style folds. We'd just replace above: > -> let make_list = \h t. \f z continue_handler abort_handler. -> f h z (\z. t f z continue_handler abort_handler) abort_handler +> let make_list = \h t. \f z continue_handler abort_handler. +> f h z (\z. t f z continue_handler abort_handler) abort_handler > > now `extract_head` should return the leftmost head directly, using its > `abort_handler`: > -> let extract_head = \lst larger_computation. lst -> (\hd sofar continue_handler abort_handler. abort_handler hd) -> junk -> larger_computation -> larger_computation +> let extract_head = \lst larger_computation. lst +> (\hd sofar continue_handler abort_handler. abort_handler hd) +> junk +> larger_computation +> larger_computation > > 3. To extract tails efficiently, too, it'd be nice to fuse the apparatus > developed in these v5 lists with the ideas from