hashable-1.0.0: Class Hashable providing a hash method.Source codeContentsIndex
Data.Hashable
Portabilityportable
Stabilityprovisional
Maintainerfox@ucw.cz
Description

Hashable class for hashable types, with instances for basic types. The only function of this class is

   hash :: Hashable h => h -> Int

The hash function should be as collision-free as possible, the probability of hash a == hash b should ideally be 1 over the number of representable values in an Int.

Returning an Int is a result of the Data.IntMap.IntMap using Int as a key, as inserting the hash values to the Data.IntMap.IntMap was the purpose of creating this class.

Synopsis
class Hashable a where
hash :: a -> Int
combine :: Int -> Int -> Int
Documentation
class Hashable a whereSource
The class containing a function hash which computes the hash values of given value.
Methods
hash :: a -> IntSource
The computed hash value should be as collision-free as possible, the probability of hash a == hash b should ideally be 1 over the number of representable values in an Int.
show/hide Instances
combine :: Int -> Int -> IntSource
Combines two given hash values.
Produced by Haddock version 2.6.1