Generates an Eq instance declaration for the given data type or data family instance.
Modulederiving-compat-0.6.8Haskell2010
Data.Eq.Deriving
Exports functions to mechanically derive Eq, Eq1, and Eq2 instances.
Note that upstream GHC does not have the ability to derive Eq1 or Eq2
instances, but since the functionality to derive Eq extends very naturally
Eq1 and Eq2, the ability to derive the latter two classes is provided as a
convenience.
- 9 values
- Packagederiving-compat-0.6.8
- Exports9
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceDeriving.hs
Eq
3 declarationsGenerates a lambda expression which behaves like (==) (without
requiring an Eq instance).
Generates a lambda expression which behaves like (/=) (without
requiring an Eq instance).
Eq1
3 declarationsGenerates an Eq1 instance declaration for the given data type or data
family instance.
Generates a lambda expression which behaves like liftEq (without
requiring an Eq1 instance).
This function is not available with transformers-0.4.
Generates a lambda expression which behaves like eq1 (without
requiring an Eq1 instance).
Eq2
3 declarationsGenerates an Eq2 instance declaration for the given data type or data
family instance.
This function is not available with transformers-0.4.
Generates a lambda expression which behaves like liftEq2 (without
requiring an Eq2 instance).
This function is not available with transformers-0.4.
Generates a lambda expression which behaves like eq2 (without
requiring an Eq2 instance).
This function is not available with transformers-0.4.
deriveEq limitations
0 declarationsBe aware of the following potential gotchas:
Type variables of kind
*are assumed to have Eq constraints. Type variables of kind* -> *are assumed to haveEq1constraints. Type variables of kind* -> * -> *are assumed to haveEq2constraints. If this is not desirable, use makeEq or one of its cousins.The
Eq1class had a different definition intransformers-0.4, and as a result, deriveEq1 implements different instances for thetransformers-0.4Eq1than it otherwise does. Also, makeLiftEq is not available when this library is built againsttransformers-0.4, only 'makeEq1.The
Eq2class is not available intransformers-0.4, and as a result, neither are Template Haskell functions that deal withEq2when this library is built againsttransformers-0.4.