deriving-compat-0.5.7: Backports of GHC deriving extensions

Data.Ord.Deriving.Internal

Description

Exports functions to mechanically derive OrdClass, Ord1, and Ord2 instances.

Note: this is an internal module, and as such, the API presented here is not guaranteed to be stable, even between minor releases of this library.

Synopsis

# OrdClass

deriveOrd :: Name -> Q [Dec] Source #

Generates an OrdClass instance declaration for the given data type or data family instance.

Generates a lambda expression which behaves like compare (without requiring an OrdClass instance).

Generates a lambda expression which behaves like '(<=)' (without requiring an OrdClass instance).

Generates a lambda expression which behaves like '(<)' (without requiring an OrdClass instance).

Generates a lambda expression which behaves like '(>)' (without requiring an OrdClass instance).

Generates a lambda expression which behaves like '(>=)' (without requiring an OrdClass instance).

Generates a lambda expression which behaves like max (without requiring an OrdClass instance).

Generates a lambda expression which behaves like min (without requiring an OrdClass instance).

# Ord1

Generates 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

Generates 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.