fixplate-0.1.5: Uniplate-style generic traversals for optionally annotated fixed-point types.Source codeContentsIndex
Data.Generics.Fixplate.Util.Hash.Class
Description
Haskell98 polymorphic Hash interface
Synopsis
class (Eq hash, Ord hash, Hashable hash) => HashValue hash where
hashWord8 :: Word8 -> hash -> hash
hashWord16 :: Word16 -> hash -> hash
hashWord32 :: Word32 -> hash -> hash
hashWord64 :: Word64 -> hash -> hash
emptyHash :: hash
hashHash :: hash -> hash -> hash
showHex :: hash -> String
class Hashable a where
hashDigest :: HashValue hash => a -> hash -> hash
computeHash :: HashValue hash => a -> hash
hashInt :: HashValue hash => Int -> hash -> hash
hashWord :: HashValue hash => Word -> hash -> hash
hashBool :: HashValue hash => Bool -> hash -> hash
hashChar :: HashValue hash => Char -> hash -> hash
Documentation
class (Eq hash, Ord hash, Hashable hash) => HashValue hash whereSource
A type class for hashes. Minimal complete definition: emptyHash, hashWord8, hashHash and showHex.
Methods
hashWord8 :: Word8 -> hash -> hashSource
hashWord16 :: Word16 -> hash -> hashSource
hashWord32 :: Word32 -> hash -> hashSource
hashWord64 :: Word64 -> hash -> hashSource
emptyHash :: hashSource
hashHash :: hash -> hash -> hashSource
showHex :: hash -> StringSource
show/hide Instances
class Hashable a whereSource

A type class of hashable objects. An instance has to compute the hash for any hash function, using the "base" types (eg. Word32).

Minimal complete definition: hashDigest. The default for computeHash is

 computeHash x = hashDigest x emptyHash
Methods
hashDigest :: HashValue hash => a -> hash -> hashSource
computeHash :: HashValue hash => a -> hashSource
show/hide Instances
hashInt :: HashValue hash => Int -> hash -> hashSource
hashWord :: HashValue hash => Word -> hash -> hashSource
hashBool :: HashValue hash => Bool -> hash -> hashSource
hashChar :: HashValue hash => Char -> hash -> hashSource
Produced by Haddock version 2.6.1