deriving-compat-0.6: Backports of GHC deriving extensions
Copyright(C) 2015-2017 Ryan Scott
LicenseBSD-style (see the file LICENSE)
MaintainerRyan Scott
PortabilityTemplate Haskell
Safe HaskellNone
LanguageHaskell2010

Data.Ord.Deriving.Internal

Contents

Description

Exports functions to mechanically derive Ord, 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

Ord

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

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

makeCompare :: Name -> Q Exp Source #

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

makeLE :: Name -> Q Exp Source #

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

makeLT :: Name -> Q Exp Source #

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

makeGT :: Name -> Q Exp Source #

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

makeGE :: Name -> Q Exp Source #

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

makeMax :: Name -> Q Exp Source #

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

makeMin :: Name -> Q Exp Source #

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

Ord1

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

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

makeLiftCompare :: Name -> Q Exp Source #

Generates a lambda expression which behaves like liftCompare (without requiring an Ord1 instance).

This function is not available with transformers-0.4.

makeCompare1 :: Name -> Q Exp Source #

Generates a lambda expression which behaves like compare1 (without requiring an Ord1 instance).

Ord2

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

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

This function is not available with transformers-0.4.

makeLiftCompare2 :: Name -> Q Exp Source #

Generates a lambda expression which behaves like liftCompare2 (without requiring an Ord2 instance).

This function is not available with transformers-0.4.

makeCompare2 :: Name -> Q Exp Source #

Generates a lambda expression which behaves like compare2 (without requiring an Ord2 instance).

This function is not available with transformers-0.4.