Re:Concurrent Hash Table Designs
by mrkeen on Friday January 02, 2026 @01:40PM
(#46467900)
STM containers does it right.
lookup :: k -> Map K v -> STM (Maybe v)
insert :: v -> k -> Map K v -> STM ()
It won't execute until you wrap it with atomically, so you're forced to be explicit about whether these things should happen in one logical step or separately.
https://hackage-content.haskell.org/package/stm-containers/d...