Pure immutable hash whose lookup is O(1).
- data StaticHash k v
- fromList :: (Eq k, Hashable k) => [(k, v)] -> StaticHash k v
- lookup :: (Eq k, Hashable k) => k -> StaticHash k v -> Maybe v
Documentation
data StaticHash k v Source
Data type for immutable hashes.
fromList :: (Eq k, Hashable k) => [(k, v)] -> StaticHash k vSource
Creating StaticHash
from a list. A prime around the length of
the list x 2 is chosen for the size of array. This may prevent
collisions.
lookup :: (Eq k, Hashable k) => k -> StaticHash k v -> Maybe vSource
Looking up StaticHash
.