IntSet.findMax generates garbage

Don Stewart dons at
Thu May 22 14:20:33 EDT 2008

Ross, are you able, as containers maintainer, to act as the designated
reviewer of Scott's IntMap patches? 

-- Don

> Hi,
> I noticed IntSet.findMax is defined (more or less) as "fst . maxView",
> but maxView allocates thunks on its way down to the max leaf, only to
> have findMax throw them away. Same for IntMap. I wrote a patch to fix
> this. I didn't test it for speed (couldn't think of a good test. I did
> test for correctness.) However, I looked at the core and the old
> version did indeed have "let"s in the loop. The new version does not.
> Also I changed the API a bit. Previously, IntMap.findMin only returned
> the bound value, not the key. Data.Map returns the pair, so I changed
> IntMap to do the same. (This seems like common sense to me.)
> Patch is attached. Can you tell I'm using this library a lot lately?
> Scott

> _______________________________________________
> Libraries mailing list
> Libraries at

More information about the Libraries mailing list