store-0.7.18: Fast binary serialization
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Store.TypeHash

Description

This module provides utilities for computing hashes based on the structural definitions of datatypes. The purpose of this is to provide a mechanism for tagging serialized data in such a way that deserialization issues can be anticipated.

Synopsis

Documentation

newtype Tagged a Source #

Constructors

Tagged 

Fields

Instances

Instances details
Data a => Data (Tagged a) Source # 
Instance details

Defined in Data.Store.TypeHash.Internal

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Tagged a -> c (Tagged a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Tagged a) #

toConstr :: Tagged a -> Constr #

dataTypeOf :: Tagged a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Tagged a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Tagged a)) #

gmapT :: (forall b. Data b => b -> b) -> Tagged a -> Tagged a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Tagged a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Tagged a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Tagged a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Tagged a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Tagged a -> m (Tagged a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Tagged a -> m (Tagged a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Tagged a -> m (Tagged a) #

Generic (Tagged a) Source # 
Instance details

Defined in Data.Store.TypeHash.Internal

Associated Types

type Rep (Tagged a) :: Type -> Type #

Methods

from :: Tagged a -> Rep (Tagged a) x #

to :: Rep (Tagged a) x -> Tagged a #

Show a => Show (Tagged a) Source # 
Instance details

Defined in Data.Store.TypeHash.Internal

Methods

showsPrec :: Int -> Tagged a -> ShowS #

show :: Tagged a -> String #

showList :: [Tagged a] -> ShowS #

NFData a => NFData (Tagged a) Source # 
Instance details

Defined in Data.Store.TypeHash.Internal

Methods

rnf :: Tagged a -> () #

Eq a => Eq (Tagged a) Source # 
Instance details

Defined in Data.Store.TypeHash.Internal

Methods

(==) :: Tagged a -> Tagged a -> Bool #

(/=) :: Tagged a -> Tagged a -> Bool #

Ord a => Ord (Tagged a) Source # 
Instance details

Defined in Data.Store.TypeHash.Internal

Methods

compare :: Tagged a -> Tagged a -> Ordering #

(<) :: Tagged a -> Tagged a -> Bool #

(<=) :: Tagged a -> Tagged a -> Bool #

(>) :: Tagged a -> Tagged a -> Bool #

(>=) :: Tagged a -> Tagged a -> Bool #

max :: Tagged a -> Tagged a -> Tagged a #

min :: Tagged a -> Tagged a -> Tagged a #

(Store a, HasTypeHash a) => Store (Tagged a) Source # 
Instance details

Defined in Data.Store.TypeHash.Internal

Methods

size :: Size (Tagged a) Source #

poke :: Tagged a -> Poke () Source #

peek :: Peek (Tagged a) Source #

type Rep (Tagged a) Source # 
Instance details

Defined in Data.Store.TypeHash.Internal

type Rep (Tagged a) = D1 ('MetaData "Tagged" "Data.Store.TypeHash.Internal" "store-0.7.18-JKaeHVOO5ISLnJjhQgwn0u" 'True) (C1 ('MetaCons "Tagged" 'PrefixI 'True) (S1 ('MetaSel ('Just "unTagged") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))

data TypeHash Source #

Instances

Instances details
Data TypeHash Source # 
Instance details

Defined in Data.Store.TypeHash.Internal

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TypeHash -> c TypeHash #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TypeHash #

toConstr :: TypeHash -> Constr #

dataTypeOf :: TypeHash -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TypeHash) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TypeHash) #

gmapT :: (forall b. Data b => b -> b) -> TypeHash -> TypeHash #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TypeHash -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TypeHash -> r #

gmapQ :: (forall d. Data d => d -> u) -> TypeHash -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> TypeHash -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> TypeHash -> m TypeHash #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TypeHash -> m TypeHash #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TypeHash -> m TypeHash #

Generic TypeHash Source # 
Instance details

Defined in Data.Store.TypeHash.Internal

Associated Types

type Rep TypeHash :: Type -> Type #

Methods

from :: TypeHash -> Rep TypeHash x #

to :: Rep TypeHash x -> TypeHash #

Show TypeHash Source # 
Instance details

Defined in Data.Store.TypeHash.Internal

NFData TypeHash Source # 
Instance details

Defined in Data.Store.TypeHash.Internal

Methods

rnf :: TypeHash -> () #

Eq TypeHash Source # 
Instance details

Defined in Data.Store.TypeHash.Internal

Ord TypeHash Source # 
Instance details

Defined in Data.Store.TypeHash.Internal

Store TypeHash Source # 
Instance details

Defined in Data.Store.TypeHash.Internal

Lift TypeHash Source # 
Instance details

Defined in Data.Store.TypeHash.Internal

Methods

lift :: Quote m => TypeHash -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => TypeHash -> Code m TypeHash #

type Rep TypeHash Source # 
Instance details

Defined in Data.Store.TypeHash.Internal

type Rep TypeHash = D1 ('MetaData "TypeHash" "Data.Store.TypeHash.Internal" "store-0.7.18-JKaeHVOO5ISLnJjhQgwn0u" 'True) (C1 ('MetaCons "TypeHash" 'PrefixI 'True) (S1 ('MetaSel ('Just "unTypeHash") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (StaticSize 20 ByteString))))

class HasTypeHash a where Source #

Methods

typeHash :: Proxy a -> TypeHash Source #

TH for generating HasTypeHash instances

mkHasTypeHash :: Type -> Q [Dec] Source #

Deprecated: Use of Data.Store.TypeHash isn't recommended, as the hashes are too unstable for most uses. Please instead consider using Data.Store.Version. See https://github.com/fpco/store/issues/53

mkManyHasTypeHash :: [Q Type] -> Q [Dec] Source #

Deprecated: Use of Data.Store.TypeHash isn't recommended, as the hashes are too unstable for most uses. Please instead consider using Data.Store.Version. See https://github.com/fpco/store/issues/53