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

Safe HaskellNone
LanguageHaskell2010

Data.PerfectHash.Construction

Description

Constructs a minimal perfect hash from a map of key-value pairs.

Implementation was adapted from Steve Hanov's Blog.

A refactoring of that Python implementation may be found here. This Haskell implementation is transliterated from that refactoring.

Synopsis

Documentation

createMinimalPerfectHash Source #

Arguments

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

key-value pairs

-> LookupTable b

output for use by lookup or a custom code generator

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

The keys must be instances of ToHashableChunks. The values may be of arbitrary type.

A HashMap is required as input to guarantee that there are no duplicate keys.

class Defaultable a Source #

Used to fill empty slots when promoting a HashMap to a Vector

Minimal complete definition

getDefault

Instances