[PRL] Accumulator for container capacity

William D Clinger will at ccs.neu.edu
Thu Sep 22 12:29:42 EDT 2005


Karl addressing Mitch:
>  that is exactly the code I had in mind and you use two foldr in a row. So
> you go through the contents of each container twice.

Karl, you are wrong.  Mitch's code uses foldr twice on intermediate
structures.  The containers themselves are traversed only once.

The double traversal of the intermediate structures is easy to
remove should you object to it, but it isn't worth our time to
show you how to improve Mitch's solution further until you come
to grips with the fact that Mitch's solution is a solution.

Will



More information about the PRL mailing list