-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Create a unique hash value for a type. -- -- Produce a hash for a type that is unique for that type. The hash takes -- both actual type names and type structure into account. This is useful -- for checking the type of persisted values. @package typehash @version 1.0.0.0 -- | Produce a hash for a type that is unique for that type. The -- hash takes both actual type names and type structure into account. -- -- The purpose of the hash of a type is to be able to store the type of a -- persisted value together with the value. By comparing the type hash of -- a persisted value and the expected value we can know if the -- persistened value is of the correct type. -- -- The current implementation is not really a hash, but a string -- representation of the type structure. module Data.TypeHash -- | The type of a hashed type. newtype TypeHash TypeHash :: String -> TypeHash -- | Turn the type of the value into a type hash. typeHash :: (Data a) => a -> TypeHash data Type Name :: String -> Type typeName :: Type -> String Data :: String -> [(String, [Field])] -> Type typeName :: Type -> String constrs :: Type -> [(String, [Field])] type Field = (String, Type) gType :: (Data a) => [String] -> a -> Type gConstr :: (Data a) => [String] -> a -> Constr -> (String, [Field]) fullTypeOf :: (Data a) => a -> TypeRep instance Typeable TypeHash instance Eq Type instance Ord Type instance Show Type instance Eq TypeHash instance Ord TypeHash instance Data TypeHash instance Show TypeHash instance Read TypeHash