| License | BSD-3-Clause |
|---|---|
| Stability | provisional |
| Portability | GHC >= 7.4 |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Data.Hashable.Generic
Description
Hashable support for GHC generics.
Since: 1.3.0.0
Synopsis
- genericHashWithSalt :: (Generic a, GHashable Zero (Rep a)) => Int -> a -> Int
- genericLiftHashWithSalt :: (Generic1 t, GHashable One (Rep1 t)) => (Int -> a -> Int) -> Int -> t a -> Int
- class GHashable arity (f :: Type -> Type) where
- ghashWithSalt :: HashArgs arity a -> Int -> f a -> Int
- data One
- data Zero
- data family HashArgs arity a
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 :: Type -> Type) where #
The class of types that can be generically hashed.
Methods
ghashWithSalt :: HashArgs arity a -> Int -> f a -> Int #
Instances
| GHashable One Par1 # | |
Defined in Data.Hashable.Generic.Instances | |
| GHashable arity (U1 :: Type -> Type) # | |
Defined in Data.Hashable.Generic.Instances | |
| GHashable arity (V1 :: Type -> Type) # | |
Defined in Data.Hashable.Generic.Instances | |
| Hashable1 f => GHashable One (Rec1 f) # | |
Defined in Data.Hashable.Generic.Instances | |
| (GHashable arity a, GHashable arity b) => GHashable arity (a :*: b) # | |
Defined in Data.Hashable.Generic.Instances | |
| (GSum arity a, GSum arity b) => GHashable arity (a :+: b) # | |
Defined in Data.Hashable.Generic.Instances | |
| Hashable a => GHashable arity (K1 i a :: Type -> Type) # | |
Defined in Data.Hashable.Generic.Instances | |
| (Hashable1 f, GHashable One g) => GHashable One (f :.: g) # | |
Defined in Data.Hashable.Generic.Instances | |
| GHashable arity a => GHashable arity (M1 i c a) # | |
Defined in Data.Hashable.Generic.Instances | |