hamtmap

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

Hash Array Mapped Tries

One of the prominent features of the Clojure language are a set of
immutable data structures with efficient manipulation operations. One of
the most innovative and important is the persistent hash map based on the
hash array mapped trie (HAMT).

This project is a port of this structure to Haskell, as Data.HamtMap. The
interface has been kept as consistent as possible with Data.Map.

Installation

Performance

The single-element operations for the hash map have logarithmic asymtotic
runtime complexity. However, it is implemented as a 32-ary tree, which means it
never exceeds a depth of 7 nodes, so you can treat them as constant-time
operations (for relatively large constants).

How it works

I wrote this code after reading the following explanatory blog posts on how the
Clojure version works. They should also provide a decent birds-eye overview of
my Haskell implementation.