Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- data HashTable k a
- newHashTable :: (Eq k, Hashable k) => Int -> IO (HashTable k a)
- lookup :: (Eq k, Hashable k) => k -> HashTable k a -> IO (Maybe a)
- delete :: (Eq k, Hashable k) => k -> HashTable k a -> IO ()
- deletes :: (Eq k, Hashable k) => [k] -> HashTable k a -> IO ()
- mapHashTable :: (Eq k, Hashable k) => (k -> a -> a) -> HashTable k a -> IO ()
- mapHashTableM_ :: (Eq k, Hashable k) => (k -> a -> IO ()) -> HashTable k a -> IO ()
- filterHashTable :: (Eq k, Hashable k) => (k -> a -> Bool) -> HashTable k a -> IO ()
- alter :: (Eq k, Hashable k) => (Maybe a -> (Maybe a, b)) -> k -> HashTable k a -> IO b
- keys :: HashTable k a -> IO [k]
- hasKey :: (Eq k, Hashable k) => k -> HashTable k a -> IO Bool
- size :: HashTable k a -> IO Int
Documentation
newHashTable :: (Eq k, Hashable k) => Int -> IO (HashTable k a) Source #
Create a new hash table with the given size.
deletes :: (Eq k, Hashable k) => [k] -> HashTable k a -> IO () Source #
Delete a collection of keys from the table. This is good for multiple deletes, as deletes from the same bucket can be grouped together.
mapHashTableM_ :: (Eq k, Hashable k) => (k -> a -> IO ()) -> HashTable k a -> IO () Source #
Monadic mapping over the values of a hash table.
alter :: (Eq k, Hashable k) => (Maybe a -> (Maybe a, b)) -> k -> HashTable k a -> IO b Source #
Create, update, or delete an entry in the hash table, returning some additional value derived from the operation. NOTE: This operation is only useful when you need to perform any of these operations at the same time -- the specialized versions of the individual behaviors all perform slightly better.