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
where
- ghashWithSalt :: HashArgs arity a -> Int -> f a -> Int
- data One
- data Zero
- data family HashArgs arity a :: Type
Implementation using Generics.
genericHashWithSalt :: ( Generic a, GHashable Zero ( Rep a)) => Int -> a -> Int Source #
Generic
hashWithSalt
.
Since: 1.3.0.0
genericLiftHashWithSalt :: ( Generic1 t, GHashable One ( Rep1 t)) => ( Int -> a -> Int ) -> Int -> t a -> Int Source #
Generic
liftHashWithSalt
.
Since: 1.3.0.0
Constraints
class GHashable arity f where Source #
The class of types that can be generically hashed.
Instances
GHashable One Par1 Source # | |
Defined in Data.Hashable.Generic.Instances |
|
GHashable arity ( U1 :: Type -> Type ) Source # | |
Defined in Data.Hashable.Generic.Instances |
|
GHashable arity ( V1 :: Type -> Type ) Source # | |
Defined in Data.Hashable.Generic.Instances |
|
Hashable1 f => GHashable One ( Rec1 f) Source # | |
Defined in Data.Hashable.Generic.Instances |
|
(GSum arity a, GSum arity b) => GHashable arity (a :+: b) Source # | |
Defined in Data.Hashable.Generic.Instances |
|
Hashable a => GHashable arity ( K1 i a :: Type -> Type ) Source # | |
Defined in Data.Hashable.Generic.Instances |
|
( GHashable arity a, GHashable arity b) => GHashable arity (a :*: b) Source # | |
Defined in Data.Hashable.Generic.Instances |
|
GHashable arity a => GHashable arity ( M1 i c a) Source # | |
Defined in Data.Hashable.Generic.Instances |
|
( Hashable1 f, GHashable One g) => GHashable One (f :.: g) Source # | |
Defined in Data.Hashable.Generic.Instances |
Instances
GHashable One Par1 Source # | |
Defined in Data.Hashable.Generic.Instances |
|
Hashable1 f => GHashable One ( Rec1 f) Source # | |
Defined in Data.Hashable.Generic.Instances |
|
( Hashable1 f, GHashable One g) => GHashable One (f :.: g) Source # | |
Defined in Data.Hashable.Generic.Instances |
|
newtype HashArgs One a Source # | |