Open
Description
Currently,
data Leaf k v = L !k v
data HashMap k v
= ...
| Leaf !Hash !(Leaf k v)
...
We never change the hash without changing the key, and therefore also the Leaf
value. So as far as I can tell, we only get a benefit from the indirection from HashMap
to Leaf
when a key-value pair moves between a Leaf
node and a Collision
node, which we assume is rare. The rest of the time, it's purely a waste of time and space. We should try using UNPACK
and check that nothing regresses unexpectedly.