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` can return the leftmost head directly, using its `abort_handler`:
+ now `extract_head` should return the leftmost head directly, using its `abort_handler`:
let extract_head = \lst larger_computation. lst
- ; here's our f
(\hd sofar continue_handler abort_handler. abort_handler hd)
- ; here's our z
junk
- ; here's the continue_handler for the leftmost application of f
larger_computation
- ; here's the abort_handler
- larger_computation in
+ 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 the v4 lists, above.
But that also is left as an exercise.
-5. Implementing (self-balancing) trees
+5. **Implementing (self-balancing) trees**
more...