hashable-1.3.0.0: A class for types that can be converted to a hash value
LicenseBSD-3-Clause
Stabilityprovisional
PortabilityGHC >= 7.4
Safe HaskellTrustworthy
LanguageHaskell2010

Data.Hashable.Generic

Description

Hashable support for GHC generics.

Since: 1.3.0.0

Synopsis

Implementation using Generics.

genericHashWithSalt :: (Generic a, GHashable Zero (Rep a)) => Int -> a -> Int #

Generic hashWithSalt.

Since: 1.3.0.0

genericLiftHashWithSalt :: (Generic1 t, GHashable One (Rep1 t)) => (Int -> a -> Int) -> Int -> t a -> Int #

Generic liftHashWithSalt.

Since: 1.3.0.0

Constraints

class GHashable arity f where #

The class of types that can be generically hashed.

Methods

ghashWithSalt :: HashArgs arity a -> Int -> f a -> Int #

Instances

Instances details
GHashable One Par1 # 
Instance details

Defined in Data.Hashable.Generic.Instances

Methods

ghashWithSalt :: HashArgs One a -> Int -> Par1 a -> Int #

GHashable arity (U1 :: Type -> Type) # 
Instance details

Defined in Data.Hashable.Generic.Instances

Methods

ghashWithSalt :: HashArgs arity a -> Int -> U1 a -> Int #

GHashable arity (V1 :: Type -> Type) # 
Instance details

Defined in Data.Hashable.Generic.Instances

Methods

ghashWithSalt :: HashArgs arity a -> Int -> V1 a -> Int #

Hashable1 f => GHashable One (Rec1 f) # 
Instance details

Defined in Data.Hashable.Generic.Instances

Methods

ghashWithSalt :: HashArgs One a -> Int -> Rec1 f a -> Int #

(GSum arity a, GSum arity b) => GHashable arity (a :+: b) # 
Instance details

Defined in Data.Hashable.Generic.Instances

Methods

ghashWithSalt :: HashArgs arity a0 -> Int -> (a :+: b) a0 -> Int #

Hashable a => GHashable arity (K1 i a :: Type -> Type) # 
Instance details

Defined in Data.Hashable.Generic.Instances

Methods

ghashWithSalt :: HashArgs arity a0 -> Int -> K1 i a a0 -> Int #

(GHashable arity a, GHashable arity b) => GHashable arity (a :*: b) # 
Instance details

Defined in Data.Hashable.Generic.Instances

Methods

ghashWithSalt :: HashArgs arity a0 -> Int -> (a :*: b) a0 -> Int #

GHashable arity a => GHashable arity (M1 i c a) # 
Instance details

Defined in Data.Hashable.Generic.Instances

Methods

ghashWithSalt :: HashArgs arity a0 -> Int -> M1 i c a a0 -> Int #

(Hashable1 f, GHashable One g) => GHashable One (f :.: g) # 
Instance details

Defined in Data.Hashable.Generic.Instances

Methods

ghashWithSalt :: HashArgs One a -> Int -> (f :.: g) a -> Int #

data One #

Instances

Instances details
GHashable One Par1 # 
Instance details

Defined in Data.Hashable.Generic.Instances

Methods

ghashWithSalt :: HashArgs One a -> Int -> Par1 a -> Int #

Hashable1 f => GHashable One (Rec1 f) # 
Instance details

Defined in Data.Hashable.Generic.Instances

Methods

ghashWithSalt :: HashArgs One a -> Int -> Rec1 f a -> Int #

(Hashable1 f, GHashable One g) => GHashable One (f :.: g) # 
Instance details

Defined in Data.Hashable.Generic.Instances

Methods

ghashWithSalt :: HashArgs One a -> Int -> (f :.: g) a -> Int #

newtype HashArgs One a # 
Instance details

Defined in Data.Hashable.Class

newtype HashArgs One a = HashArgs1 (Int -> a -> Int)

data Zero #

Instances

Instances details
data HashArgs Zero a # 
Instance details

Defined in Data.Hashable.Class

data family HashArgs arity a :: * #

Instances

Instances details
newtype HashArgs One a # 
Instance details

Defined in Data.Hashable.Class

newtype HashArgs One a = HashArgs1 (Int -> a -> Int)
data HashArgs Zero a # 
Instance details

Defined in Data.Hashable.Class