-- 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.4.0.3
-- | 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 hash of expected type we can know if the
-- persistened value is of the correct type.
--
-- The type hash uses a cryptographic hash and can only be used to test
-- equality.
--
-- The type code preserves the exact structure of the type and can be
-- used to check if one type is convertible to another in various ways.
--
-- This module uses the reflection offered by Typeable and
-- Data to extract the information.
module Data.TypeHash
-- | Type codes.
data TypeCode
-- | Turn the type of the value into a type code.
typeCode :: Data a => a -> TypeCode
-- | Are the types strongly isomorphic, only allows change of type names.
convertibleIso :: TypeCode -> TypeCode -> Bool
-- | Can read . show convert the first type to the second? Allows
-- changing type names, allows permuting and/or adding constructors to
-- the new type, also allows permuting named fields of a constructor.
convertibleWithReadShow :: TypeCode -> TypeCode -> Bool
-- | Can the generic JSON serializer and deserializer convert the first
-- type to the second. Allows changing type names, allows permuting
-- and/or adding constructors to the new type, also allows permuting
-- and/or deleting named fields of a constructor. Furhermore, allows
-- types with a single constructor to change constructor name.
convertibleWithJSON :: TypeCode -> TypeCode -> Bool
-- | Type hash.
data TypeHash
-- | Turn the type of the value into a type hash.
typeHash :: Data a => a -> TypeHash
instance Typeable TypeHash
instance Typeable Type
instance Typeable TypeCode
instance Eq TypeHash
instance Ord TypeHash
instance Data TypeHash
instance Show TypeHash
instance Read TypeHash
instance Binary TypeHash
instance Eq Type
instance Ord Type
instance Show Type
instance Data Type
instance Eq TypeCode
instance Ord TypeCode
instance Data TypeCode
instance Show TypeCode
instance Eq How