[Haskell-cafe] ANN: unordered-containers - a new, faster hashing-based containers library
Felipe Almeida Lessa
felipe.lessa at gmail.com
Mon Feb 21 14:07:56 CET 2011
On Mon, Feb 21, 2011 at 12:58 PM, Max Cantor <mxcantor at gmail.com> wrote:
> If you want to use the library and need a short term fix, just write a small wrapper type/module
>
> newtype SizedMap = SizedMap (Int, HashMap) and track the size yourself. only complication is that on inserts and deletes you'll need to check if the key existed. other than that, it shouldn't be too difficult.
>
> This way, the library stays super optimized but, if you need, you can track the size. As Johan said, it would slow down insert and delete a bit. shouldn't affect lookup though..
This isn't sufficient in all cases. How would you know the resulting
size of a union or intersection?
Cheers,
--
Felipe.
More information about the Haskell-Cafe
mailing list