Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data IOHashMap k v
- newIOHashMap :: MonadIO m => HashMap k v -> m (IOHashMap k v)
- readIOHashMap :: MonadIO m => (HashMap k v -> a) -> IOHashMap k v -> m a
- modifyIOHashMap :: MonadIO m => (HashMap k v -> HashMap k v) -> IOHashMap k v -> m ()
- empty :: MonadIO m => m (IOHashMap k v)
- singleton :: MonadIO m => Hashable k => k -> v -> m (IOHashMap k v)
- null :: MonadIO m => IOHashMap k v -> m Bool
- size :: MonadIO m => IOHashMap k v -> m Int
- member :: (MonadIO m, Eq k, Hashable k) => k -> IOHashMap k a -> m Bool
- lookup :: (MonadIO m, Eq k, Hashable k) => k -> IOHashMap k v -> m (Maybe v)
- (!?) :: (MonadIO m, Eq k, Hashable k) => IOHashMap k v -> k -> m (Maybe v)
- findWithDefault :: (MonadIO m, Eq k, Hashable k) => v -> k -> IOHashMap k v -> m v
- (!) :: (MonadIO m, Eq k, Hashable k) => IOHashMap k v -> k -> m v
- insert :: (MonadIO m, Eq k, Hashable k) => k -> v -> IOHashMap k v -> m ()
- insertWith :: (MonadIO m, Eq k, Hashable k) => (v -> v -> v) -> k -> v -> IOHashMap k v -> m ()
- delete :: (MonadIO m, Eq k, Hashable k) => k -> IOHashMap k v -> m ()
- adjust :: MonadIO m => (Eq k, Hashable k) => (v -> v) -> k -> IOHashMap k v -> m ()
- update :: (MonadIO m, Eq k, Hashable k) => (a -> Maybe a) -> k -> IOHashMap k a -> m ()
- alter :: (MonadIO m, Eq k, Hashable k) => (Maybe v -> Maybe v) -> k -> IOHashMap k v -> m ()
- foldMapWithKey :: (MonadIO m, Monoid n) => (k -> v -> n) -> IOHashMap k v -> m n
- foldr :: MonadIO m => (v -> a -> a) -> a -> IOHashMap k v -> m a
- foldl :: MonadIO m => (a -> v -> a) -> a -> IOHashMap k v -> m a
- foldr' :: MonadIO m => (v -> a -> a) -> a -> IOHashMap k v -> m a
- foldl' :: MonadIO m => (a -> v -> a) -> a -> IOHashMap k v -> m a
- foldrWithKey' :: MonadIO m => (k -> v -> a -> a) -> a -> IOHashMap k v -> m a
- foldlWithKey' :: MonadIO m => (a -> k -> v -> a) -> a -> IOHashMap k v -> m a
- foldrWithKey :: MonadIO m => (k -> v -> a -> a) -> a -> IOHashMap k v -> m a
- foldlWithKey :: MonadIO m => (a -> k -> v -> a) -> a -> IOHashMap k v -> m a
- keys :: MonadIO m => IOHashMap k v -> m [k]
- elems :: MonadIO m => IOHashMap k v -> m [v]
- toList :: MonadIO m => IOHashMap k v -> m [(k, v)]
- fromList :: (MonadIO m, Eq k, Hashable k) => [(k, v)] -> m (IOHashMap k v)
Documentation
singleton :: MonadIO m => Hashable k => k -> v -> m (IOHashMap k v) Source #
O(1) Construct a map with a single element.
size :: MonadIO m => IOHashMap k v -> m Int Source #
O(n) Return the number of key-value mappings in this map.
lookup :: (MonadIO m, Eq k, Hashable k) => k -> IOHashMap k v -> m (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
(!) :: (MonadIO m, Eq k, Hashable k) => IOHashMap k v -> k -> m 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 :: (MonadIO m, Eq k, Hashable k) => k -> v -> IOHashMap k v -> m () 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 :: (MonadIO m, Eq k, Hashable k) => (v -> v -> v) -> k -> v -> IOHashMap k v -> m () 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 :: (MonadIO m, Eq k, Hashable k) => k -> IOHashMap k v -> m () Source #
O(log n) Remove the mapping for the specified key from this map if present.
adjust :: MonadIO m => (Eq k, Hashable k) => (v -> v) -> k -> IOHashMap k v -> m () 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.
alter :: (MonadIO m, Eq k, Hashable k) => (Maybe v -> Maybe v) -> k -> IOHashMap k v -> m () Source #
foldMapWithKey :: (MonadIO m, Monoid n) => (k -> v -> n) -> IOHashMap k v -> m n Source #
O(n) Reduce the map by applying a function to each element and combining the results with a monoid operation.
foldr :: MonadIO m => (v -> a -> a) -> a -> IOHashMap k v -> m 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 :: MonadIO m => (a -> v -> a) -> a -> IOHashMap k v -> m 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' :: MonadIO m => (v -> a -> a) -> a -> IOHashMap k v -> m 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' :: MonadIO m => (a -> v -> a) -> a -> IOHashMap k v -> m 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' :: MonadIO m => (k -> v -> a -> a) -> a -> IOHashMap k v -> m 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' :: MonadIO m => (a -> k -> v -> a) -> a -> IOHashMap k v -> m 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 :: MonadIO m => (k -> v -> a -> a) -> a -> IOHashMap k v -> m 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 :: MonadIO m => (a -> k -> v -> a) -> a -> IOHashMap k v -> m 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 :: MonadIO m => IOHashMap k v -> m [k] Source #
O(n) Return a list of this map's keys. The list is produced lazily.
elems :: MonadIO m => IOHashMap k v -> m [v] Source #
O(n) Return a list of this map's values. The list is produced lazily.