Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

- newtype TMapChan k a = TMapChan {
- runTMapChan :: TVar (Map k (TChan a))

- newTMapChan :: STM (TMapChan k a)
- insert :: Ord k => TMapChan k a -> k -> a -> STM ()
- insertMany :: Ord k => TMapChan k a -> k -> [a] -> STM ()
- insertFirst :: Ord k => TMapChan k a -> k -> a -> STM ()
- lookup :: Ord k => TMapChan k a -> k -> STM a
- tryLookup :: Ord k => TMapChan k a -> k -> STM (Maybe a)
- lookupAll :: Ord k => TMapChan k a -> k -> STM [a]
- observe :: Ord k => TMapChan k a -> k -> STM a
- tryObserve :: Ord k => TMapChan k a -> k -> STM (Maybe a)
- observeAll :: Ord k => TMapChan k a -> k -> STM [a]
- delete :: Ord k => TMapChan k a -> k -> STM ()
- deleteAll :: Ord k => TMapChan k a -> k -> STM ()
- getTChan :: Ord k => TMapChan k a -> k -> STM (TChan a)
- setTChan :: Ord k => TMapChan k a -> k -> TChan a -> STM ()
- keys :: TMapChan k a -> STM [k]
- broadcast :: Ord k => TMapChan k a -> a -> STM ()
- cloneAt :: Ord k => TMapChan k a -> k -> k -> STM ()
- cloneAll :: Ord k => TMapChan k a -> k -> STM ()
- cloneAllUniquely :: (Ord k, Ord a) => TMapChan k a -> k -> STM ()

# Documentation

newTMapChan :: STM (TMapChan k a) Source

insertMany :: Ord k => TMapChan k a -> k -> [a] -> STM () Source

insertFirst :: Ord k => TMapChan k a -> k -> a -> STM () Source

Inserts the element to the head of the stack, to be viewed next

lookup :: Ord k => TMapChan k a -> k -> STM a Source

Blocks until there's a value available to remove from the mutlimap

observe :: Ord k => TMapChan k a -> k -> STM a Source

Blocks until there's a vale available to view, without removing it

observeAll :: Ord k => TMapChan k a -> k -> STM [a] Source

delete :: Ord k => TMapChan k a -> k -> STM () Source

Deletes the *next* element in the map, if it exists. Doesn't block.

# Utils

getTChan :: Ord k => TMapChan k a -> k -> STM (TChan a) Source

Creates a new one if it doesn't already exist