[PRL] Accumulator for container capacity

Karl Lieberherr karl.lieberherr at gmail.com
Thu Sep 22 13:19:44 EDT 2005


Ethan showed me how to remove that double traversal of the intermediate
structure (which is as long as the container contents).
 So which of the two solutions is preferred: Mitch's without the double fold
or Matthias' solution with !.
 I vote for Matthias solution although I conjecture I will be overruled.
 -- Karl
 On 9/22/05, William D Clinger <will at ccs.neu.edu> wrote:
>
> 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
>
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the PRL mailing list