large-hashable-0.1.0.4: Efficiently hash (large) Haskell values

Safe HaskellNone
LanguageHaskell2010

Data.LargeHashable.Intern

Description

Generic, low-level data types for hashing. This is an internal module.

You should only import this module if you write your own hash algorithm or if you need access to low-level hashing functions when defining instances of LargeHash.

Regular users should not import this module. Import LargeHashable instead.

Synopsis

Documentation

data HashUpdates Source #

Functions for updating an intermediate hash value. The functions live in the IO monad because they are typically implemented via FFI.

Constructors

HashUpdates 

Fields

data HashAlgorithm h Source #

The interface for a hashing algorithm. The interface contains a simple run function, which is used to update the hash with all values needed, and the outputs the resulting hash.

Constructors

HashAlgorithm 

Fields

data LH a Source #

The LH monad (LH stands for "large hash") is used in the definition of hashing functions for arbitrary data types.

Instances

Monad LH Source # 

Methods

(>>=) :: LH a -> (a -> LH b) -> LH b #

(>>) :: LH a -> LH b -> LH b #

return :: a -> LH a #

fail :: String -> LH a #

Functor LH Source # 

Methods

fmap :: (a -> b) -> LH a -> LH b #

(<$) :: a -> LH b -> LH a #

Applicative LH Source # 

Methods

pure :: a -> LH a #

(<*>) :: LH (a -> b) -> LH a -> LH b #

(*>) :: LH a -> LH b -> LH b #

(<*) :: LH a -> LH b -> LH a #

ioInLH :: IO a -> LH a Source #

Perform an IO action in the LH monad. Use with care, do not perform arbitrary IO operation with this function! Only use it for calling functions of the HashUpdates datatype.

runLH :: HashAlgorithm h -> LH () -> h Source #

Runs a LH computation and returns the resulting hash.

updateXorHash :: [LH ()] -> LH () Source #