unordered-containers

Efficient hashing-based container types

https://github.com/haskell-unordered-containers/unordered-containers

LTS Haskell 23.27:0.2.20@rev:4
Stackage Nightly 2025-07-12:0.2.20@rev:4
Latest on Hackage:0.2.20@rev:4

See all snapshotsunordered-containers appears in

BSD-3-Clause licensedbyJohan Tibell
This version can be pinned in stack with:unordered-containers-0.2.20@sha256:233cbcdda6c2698932bb391ce0935fb44f80c115621ee815a21ed33ac8ede422,3921

Efficient hashing-based container types. The containers have beenoptimized for performance critical use, both in terms of large dataquantities and high speed.

The declared cost of each operation is either worst-case oramortized, but remains valid even if structures are shared.

Security

This package currently provides no defenses against hash collision attackssuch as HashDoS.Users who need to store input from untrusted sources are advised to useData.Map orData.Set from thecontainers package instead.

Changes

[0.2.20] - January 2024

0.2.19.1 – April 2022

0.2.19.0 – April 2022

0.2.18.0

0.2.17.0

0.2.16.0

0.2.15.0

0.2.14.0

0.2.13.0

0.2.12.0

  • AddHashMap.isSubmapOf[By] andHashSet.isSubsetOf. Thanks Sven Keidel. (#282)

  • Expose internal modules. (#283)

  • Documentation improvements inData.HashSet, including a beginner-friendlyintroduction. Thanks Matt Renaud. (#267)

  • HashMap.alterF: Skip key deletion for absent keys. (#288)

  • Remove customunsafeShift{L,R} definitions. (#281)

  • Various other documentation improvements.

0.2.11.0

  • AddHashMap.findWithDefault (soft-deprecatesHashMap.lookupDefault).Thanks, Matt Renaud.

  • AddHashMap.fromListWithKey. Thanks, Josef Svenningsson.

  • Add more folding functions and use them inFoldable instances. Thanks,David Feuer.

  • AddHashMap.!?, a flipped version oflookup. Thanks, Matt Renaud.

  • Add aBifoldable instance forHashMap. Thanks, Joseph Sible.

  • Add aHasCallStack constraint to(!). Thanks, Roman Cheplyaka.

Bug fixes

  • Fix a space leak affecting updates on keys with hash collisions. Thanks,Neil Mitchell. (#254)

  • Get rid of some silly thunks that could be left lying around. (#232).Thanks, David Feuer.

Other changes

  • Speed up theHashable instances forHashMap andHashSet. Thanks,Edward Amsden.

  • Remove a dependency cycle hack from the benchmark suite. Thanks,Andrew Martin.

  • Improve documentation. Thanks, Tristan McLeay, Li-yao Xia, Gareth Smith,Simon Jakobi, Sergey Vinokurov, and likely others.

0.2.10.0

  • AddHashMap.alterF.

  • AddHashMap.keysSet.

  • MakeHashMap.Strict.traverseWithKey force the results beforeinstalling them in the map.

0.2.9.0

  • AddOrd/Ord1/Ord2 instances. (Thanks, Oleg Grenrus)

  • UseSmallArray# instead ofArray# for GHC versions 7.10 and above.(Thanks, Dmitry Ivanov)

  • Adjust forSemigroup => Monoid proposal implementation.(Thanks, Ryan Scott)

Bug fixes

  • Fix a strictness bug infromListWith.

  • Enable eager blackholing for pre-8.2 GHC versions to work arounda runtime system bug. (Thanks, Ben Gamari)

  • Avoid sketchy reimplementation ofST when compiling with recentGHC.

Other changes

  • Remove support for GHC versions before 7.8. (Thanks, Dmitry Ivanov)

  • Add internal documentaton. (Thanks, Johan Tibell)

0.2.8.0

  • AddEq1/2,Show1/2,Read1 instances withbase-4.9

  • Eq (HashSet a) doesn’t requireHashable a anymore, onlyEq a.

  • AddHashable1/2 withhashable-1.2.6.0

  • AdddifferenceWith function.

0.2.7.2

  • Don’t use -fregs-graphs

  • Fix benchmark compilation on stack.

0.2.7.1

  • Fix linker error related to popcnt.

  • Haddock improvements.

  • Fix benchmark compilation when downloaded from Hackage.

0.2.7.0

  • Support criterion 1.1

  • Add unionWithKey for hash maps.

0.2.6.0

  • Mark several modules as Trustworthy.

  • Add Hashable instances for HashMap and HashSet.

  • Add mapMaybe, mapMaybeWithKey, update, alter, andintersectionWithKey.

  • Add roles.

  • Add Hashable and Semigroup instances.

0.2.5.1 (2014-10-11)

  • Support base-4.8