static-hash-0.0.2: Immutable hash
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.StaticHash

Description

Pure immutable hash whose lookup is O(1) on the average, but O(N) in the worst case.

Synopsis

Documentation

data StaticHash k v Source #

Data type for immutable hashes.

Instances

Instances details
(Show k, Show v) => Show (StaticHash k v) Source # 
Instance details

Defined in Data.StaticHash

Methods

showsPrec :: Int -> StaticHash k v -> ShowS #

show :: StaticHash k v -> String #

showList :: [StaticHash k v] -> ShowS #

fromList :: (Eq k, Ord k, Hashable k) => [(k, v)] -> StaticHash k v Source #

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.

fromList' :: (Eq k, Ord k, Hashable k) => Int -> [(k, v)] -> StaticHash k v Source #

Creating StaticHash from a list and its size.

lookup :: (Eq k, Ord k, Hashable k) => k -> StaticHash k v -> Maybe v Source #

Looking up StaticHash.