[Haskell-cafe] ANN: unordered-containers - a new, faster hashing-based containers library

Johan Tibell johan.tibell at gmail.com
Wed Feb 23 22:18:00 CET 2011


On Wed, Feb 23, 2011 at 12:57 PM, Gwern Branwen <gwern0 at gmail.com> wrote:
> On Wed, Feb 23, 2011 at 12:45 AM, Max Bolingbroke
> <batterseapower at hotmail.com> wrote:
>> I'm a bit sceptical that it is (I was not convinced by the earlier
>> strict-set-inclusion argument, since that's another Data.Map feature
>> I've never used). I thought of some other possibilities though:
>>  1. If copying an unordered-collection to a flat array you can improve
>> the constant factors (not the asymptotics) with O(1) size to
>> pre-allocate the array
>
> For kicks, I grepped my local repos for users of Data.Set's size
> function. My results are imperfect (I have few Github repos, I didn't
> check .lhs files, I only grepped files for 'Set.size' or 'S.size'),
> but I found around 100 uses of Data.Set.size.

Could you manually look at some of them to see if you find something
interesting. In particular `Set.size s == 0` (a common use of size in
imperative languages) could be replaced by `Set.null s`.

Johan



More information about the Haskell-Cafe mailing list