perfect-hash-generator-0.2.0.4: Perfect minimal hashing implementation in native Haskell

Safe HaskellNone
LanguageHaskell2010

Data.PerfectHash.Construction

Description

Constructs a minimal perfect hash.

Implementation was transliterated from Python on Steve Hanov's Blog and then refactored.

Synopsis

Documentation

createMinimalPerfectHash Source #

Arguments

:: (Unbox b, Defaultable b, ToHashableChunks a, Eq a, Hashable a) 
=> [(a, b)]

key-value pairs

-> LookupTable b 

Generates a minimal perfect hash for a set of key-value pairs.

The keys must be Foldables of ToNumeric instances in order to be hashable. The values may be of arbitrary type.

N.b. It is assumed that the input tuples list has no duplicate keys.