Generates an Ord instance declaration for the given data type or data family instance.
Modulederiving-compat-0.6.8Haskell2010
Data.Ord.Deriving
Exports functions to mechanically derive Ord, Ord1, and Ord2 instances.
Note that upstream GHC does not have the ability to derive Ord1 or Ord2
instances, but since the functionality to derive Ord extends very naturally
Ord1 and Ord2, the ability to derive the latter two classes is provided as a
convenience.
- 14 values
- Packagederiving-compat-0.6.8
- Exports14
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceDeriving.hs
Ord
8 declarationsGenerates a lambda expression which behaves like (<) (without
requiring an Ord instance).
Generates a lambda expression which behaves like (<=) (without
requiring an Ord instance).
Generates a lambda expression which behaves like (>) (without
requiring an Ord instance).
Generates a lambda expression which behaves like (>=) (without
requiring an Ord instance).
Ord1
3 declarationsGenerates an Ord1 instance declaration for the given data type or data
family instance.
Generates a lambda expression which behaves like liftCompare (without
requiring an Ord1 instance).
This function is not available with transformers-0.4.
Generates a lambda expression which behaves like compare1 (without
requiring an Ord1 instance).
Ord2
3 declarationsGenerates an Ord2 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 liftCompare2 (without
requiring an Ord2 instance).
This function is not available with transformers-0.4.
Generates a lambda expression which behaves like compare2 (without
requiring an Ord2 instance).
This function is not available with transformers-0.4.
deriveOrd limitations
0 declarationsBe aware of the following potential gotchas:
Type variables of kind
*are assumed to have Ord constraints. Type variables of kind* -> *are assumed to haveOrd1constraints. Type variables of kind* -> * -> *are assumed to haveOrd2constraints. If this is not desirable, use makeCompare or one of its cousins.The
Ord1class had a different definition intransformers-0.4, and as a result, deriveOrd1 implements different instances for thetransformers-0.4Ord1than it otherwise does. Also, makeLiftCompare is not available when this library is built againsttransformers-0.4, only 'makeCompare1.The
Ord2class is not available intransformers-0.4, and as a result, neither are Template Haskell functions that deal withOrd2when this library is built againsttransformers-0.4.