-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | A class for types that can be converted to a hash value
--
-- This package defines a class, Hashable, for types that can be
-- converted to a hash value. This class exists for the benefit of
-- hashing-based data structures. The package provides instances for
-- basic types and a way to combine hash values.
@package hashable
@version 1.1.2.2
-- | This module defines a class, Hashable, for types that can be
-- converted to a hash value. This class exists for the benefit of
-- hashing-based data structures. The module provides instances for basic
-- types and a way to combine hash values.
--
-- The hash function should be as collision-free as possible,
-- which means that the hash function must map the inputs to the
-- hash values as evenly as possible.
module Data.Hashable
-- | The class of types that can be converted to a hash value.
--
-- Minimal implementation: hash or hashWithSalt.
class Hashable a where hash = hashWithSalt defaultSalt hashWithSalt salt x = salt `combine` hash x
hash :: Hashable a => a -> Int
hashWithSalt :: Hashable a => Int -> a -> Int
-- | Compute a hash value for the content of this pointer.
hashPtr :: Ptr a -> Int -> IO Int
-- | Compute a hash value for the content of this pointer, using an initial
-- salt.
--
-- This function can for example be used to hash non-contiguous segments
-- of memory as if they were one contiguous segment, by using the output
-- of one hash as the salt for the next.
hashPtrWithSalt :: Ptr a -> Int -> Int -> IO Int
-- | Compute a hash value for the content of this ByteArray#,
-- beginning at the specified offset, using specified number of bytes.
-- Availability: GHC.
hashByteArray :: ByteArray# -> Int -> Int -> Int
-- | Compute a hash value for the content of this ByteArray#, using
-- an initial salt.
--
-- This function can for example be used to hash non-contiguous segments
-- of memory as if they were one contiguous segment, by using the output
-- of one hash as the salt for the next.
--
-- Availability: GHC.
hashByteArrayWithSalt :: ByteArray# -> Int -> Int -> Int -> Int
-- | Combine two given hash values. combine has zero as a left
-- identity.
combine :: Int -> Int -> Int
instance Hashable Text
instance Hashable Text
instance Hashable ByteString
instance Hashable ByteString
instance Hashable ThreadId
instance Hashable a => Hashable [a]
instance Hashable (StableName a)
instance (Hashable a1, Hashable a2, Hashable a3, Hashable a4, Hashable a5, Hashable a6, Hashable a7) => Hashable (a1, a2, a3, a4, a5, a6, a7)
instance (Hashable a1, Hashable a2, Hashable a3, Hashable a4, Hashable a5, Hashable a6) => Hashable (a1, a2, a3, a4, a5, a6)
instance (Hashable a1, Hashable a2, Hashable a3, Hashable a4, Hashable a5) => Hashable (a1, a2, a3, a4, a5)
instance (Hashable a1, Hashable a2, Hashable a3, Hashable a4) => Hashable (a1, a2, a3, a4)
instance (Hashable a1, Hashable a2, Hashable a3) => Hashable (a1, a2, a3)
instance (Hashable a1, Hashable a2) => Hashable (a1, a2)
instance (Hashable a, Hashable b) => Hashable (Either a b)
instance Hashable a => Hashable (Maybe a)
instance Hashable Char
instance Hashable Double
instance Hashable Float
instance (Integral a, Hashable a) => Hashable (Ratio a)
instance Hashable Integer
instance Hashable Word64
instance Hashable Word32
instance Hashable Word16
instance Hashable Word8
instance Hashable Word
instance Hashable Int64
instance Hashable Int32
instance Hashable Int16
instance Hashable Int8
instance Hashable Int
instance Hashable Bool
instance Hashable ()