ekmett / stable-maps

Heterogeneous collections indexed by StableNames
http://github.com/ekmett/stable-maps
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

insert looks really weird #5

Closed treeowl closed 6 years ago

treeowl commented 6 years ago
insert :: DynamicStableName -> a -> Map a -> Map a
insert k v = Map . IntMap.insertWith (++) (hashDynamicStableName k) [(k,v)] . getMap

I can't immediately tell if it's correct or not, but inserting the same key many times will make the collision bucket grow without bound.