Agda-2.8.0: A dependently typed functional programming language and proof assistant

Safe Haskell | None
Language | Haskell2010

Agda.Utils.HashTable

Description

Hash tables.

Synopsis

- data HashTable k v
- empty :: IO (HashTable k v)
- insert :: (Eq k, Hashable k) => HashTable k v -> k -> v -> IO ()
- lookup :: (Eq k, Hashable k) => HashTable k v -> k -> IO (Maybe v)
- toList :: (Eq k, Hashable k) => HashTable k v -> IO [(k, v)]
- keySet :: Ord k => HashTable k v -> IO (Set k)

# Documentation

data HashTable k v Source #

Hash tables.

empty :: IO (HashTable k v) Source #

An empty hash table.

insert :: (Eq k, Hashable k) => HashTable k v -> k -> v -> IO () Source #

Inserts the key and the corresponding value into the hash table.

lookup :: (Eq k, Hashable k) => HashTable k v -> k -> IO (Maybe v) Source #

Tries to find a value corresponding to the key in the hash table.

toList :: (Eq k, Hashable k) => HashTable k v -> IO [(k, v)] Source #

Converts the hash table to a list.

The order of the elements in the list is unspecified.

keySet :: Ord k => HashTable k v -> IO (Set k) Source #