3 ms·
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 atomi
by mrkeen 10mo ago
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/docs/StmContainers-Map.html https://hackage-content.haskell.org/package/stm-containers/d...