Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype TMap k v = TMap {}
- new :: STM (TMap k v)
- reset :: TMap k v -> STM ()
- null :: TMap k v -> STM Bool
- lookup :: (Eq k, Hashable k) => k -> TMap k v -> STM (Maybe v)
- insert :: (Eq k, Hashable k) => v -> k -> TMap k v -> STM ()
- delete :: (Eq k, Hashable k) => k -> TMap k v -> STM ()
- toList :: TMap k v -> STM [(k, v)]
- filterWithKey :: (k -> v -> Bool) -> TMap k v -> STM ()
- replace :: TMap k v -> HashMap k v -> STM ()
- union :: (Eq k, Hashable k) => TMap k v -> TMap k v -> STM (TMap k v)
- getMap :: TMap k v -> STM (HashMap k v)
Documentation
A coarse-grained transactional map implemented by simply wrapping a HashMap
in a TVar
.
Compared to StmContainers.Map, this provides much faster iteration over the elements at the
cost of significantly increased contention on writes.