Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data IOHashMap k v
- newIOHashMap :: HashMap k v -> STM (IOHashMap k v)
- readIOHashMap :: (HashMap k v -> a) -> IOHashMap k v -> STM a
- modifyIOHashMap :: (HashMap k v -> HashMap k v) -> IOHashMap k v -> STM ()
- empty :: STM (IOHashMap k v)
- singleton :: Hashable k => k -> v -> STM (IOHashMap k v)
- null :: IOHashMap k v -> STM Bool
- size :: IOHashMap k v -> STM Int
- member :: (Eq k, Hashable k) => k -> IOHashMap k a -> STM Bool
- lookup :: (Eq k, Hashable k) => k -> IOHashMap k v -> STM (Maybe v)
- (!?) :: (Eq k, Hashable k) => IOHashMap k v -> k -> STM (Maybe v)
- findWithDefault :: (Eq k, Hashable k) => v -> k -> IOHashMap k v -> STM v
- (!) :: (Eq k, Hashable k) => IOHashMap k v -> k -> STM v
- insert :: (Eq k, Hashable k) => k -> v -> IOHashMap k v -> STM ()
- insertWith :: (Eq k, Hashable k) => (v -> v -> v) -> k -> v -> IOHashMap k v -> STM ()
- delete :: (Eq k, Hashable k) => k -> IOHashMap k v -> STM ()
- adjust :: (Eq k, Hashable k) => (v -> v) -> k -> IOHashMap k v -> STM ()
- update :: (Eq k, Hashable k) => (a -> Maybe a) -> k -> IOHashMap k a -> STM ()
- alter :: (Eq k, Hashable k) => (Maybe v -> Maybe v) -> k -> IOHashMap k v -> STM ()
- foldMapWithKey :: Monoid m => (k -> v -> m) -> IOHashMap k v -> STM m
- foldr :: (v -> a -> a) -> a -> IOHashMap k v -> STM a
- foldl :: (a -> v -> a) -> a -> IOHashMap k v -> STM a
- foldr' :: (v -> a -> a) -> a -> IOHashMap k v -> STM a
- foldl' :: (a -> v -> a) -> a -> IOHashMap k v -> STM a
- foldrWithKey' :: (k -> v -> a -> a) -> a -> IOHashMap k v -> STM a
- foldlWithKey' :: (a -> k -> v -> a) -> a -> IOHashMap k v -> STM a
- foldrWithKey :: (k -> v -> a -> a) -> a -> IOHashMap k v -> STM a
- foldlWithKey :: (a -> k -> v -> a) -> a -> IOHashMap k v -> STM a
- keys :: IOHashMap k v -> STM [k]
- elems :: IOHashMap k v -> STM [v]
- toList :: IOHashMap k v -> STM [(k, v)]
- fromList :: (Eq k, Hashable k) => [(k, v)] -> STM (IOHashMap k v)
Documentation
singleton :: Hashable k => k -> v -> STM (IOHashMap k v) Source #
O(1) Construct a map with a single element.
lookup :: (Eq k, Hashable k) => k -> IOHashMap k v -> STM (Maybe v) Source #
O(log n) Return the value to which the specified key is mapped,
or Nothing
if this map contains no mapping for the key.
O(log n) Return the value to which the specified key is mapped, or the default value if this map contains no mapping for the key.
Since: 0.2.11
(!) :: (Eq k, Hashable k) => IOHashMap k v -> k -> STM v infixl 9 Source #
O(log n) Return the value to which the specified key is mapped.
Calls error
if this map contains no mapping for the key.
insert :: (Eq k, Hashable k) => k -> v -> IOHashMap k v -> STM () Source #
O(log n) Associate the specified value with the specified key in this map. If this map previously contained a mapping for the key, the old value is replaced.
insertWith :: (Eq k, Hashable k) => (v -> v -> v) -> k -> v -> IOHashMap k v -> STM () Source #
O(log n) Associate the value with the key in this map. If this map previously contained a mapping for the key, the old value is replaced by the result of applying the given function to the new and old value. Example:
insertWith f k v map where f new old = new + old
delete :: (Eq k, Hashable k) => k -> IOHashMap k v -> STM () Source #
O(log n) Remove the mapping for the specified key from this map if present.
adjust :: (Eq k, Hashable k) => (v -> v) -> k -> IOHashMap k v -> STM () Source #
O(log n) Adjust the value tied to a given key in this map only if it is present. Otherwise, leave the map alone.
foldMapWithKey :: Monoid m => (k -> v -> m) -> IOHashMap k v -> STM m Source #
O(n) Reduce the map by applying a function to each element and combining the results with a monoid operation.
foldr :: (v -> a -> a) -> a -> IOHashMap k v -> STM a Source #
O(n) Reduce this map by applying a binary operator to all elements, using the given starting value (typically the right-identity of the operator).
foldl :: (a -> v -> a) -> a -> IOHashMap k v -> STM a Source #
O(n) Reduce this map by applying a binary operator to all elements, using the given starting value (typically the left-identity of the operator).
foldr' :: (v -> a -> a) -> a -> IOHashMap k v -> STM a Source #
O(n) Reduce this map by applying a binary operator to all elements, using the given starting value (typically the right-identity of the operator). Each application of the operator is evaluated before using the result in the next application. This function is strict in the starting value.
foldl' :: (a -> v -> a) -> a -> IOHashMap k v -> STM a Source #
O(n) Reduce this map by applying a binary operator to all elements, using the given starting value (typically the left-identity of the operator). Each application of the operator is evaluated before using the result in the next application. This function is strict in the starting value.
foldrWithKey' :: (k -> v -> a -> a) -> a -> IOHashMap k v -> STM a Source #
O(n) Reduce this map by applying a binary operator to all elements, using the given starting value (typically the right-identity of the operator). Each application of the operator is evaluated before using the result in the next application. This function is strict in the starting value.
foldlWithKey' :: (a -> k -> v -> a) -> a -> IOHashMap k v -> STM a Source #
O(n) Reduce this map by applying a binary operator to all elements, using the given starting value (typically the left-identity of the operator). Each application of the operator is evaluated before using the result in the next application. This function is strict in the starting value.
foldrWithKey :: (k -> v -> a -> a) -> a -> IOHashMap k v -> STM a Source #
O(n) Reduce this map by applying a binary operator to all elements, using the given starting value (typically the right-identity of the operator).
foldlWithKey :: (a -> k -> v -> a) -> a -> IOHashMap k v -> STM a Source #
O(n) Reduce this map by applying a binary operator to all elements, using the given starting value (typically the left-identity of the operator).
keys :: IOHashMap k v -> STM [k] Source #
O(n) Return a list of this map's keys. The list is produced lazily.
elems :: IOHashMap k v -> STM [v] Source #
O(n) Return a list of this map's values. The list is produced lazily.