deriving-compat-0.6.6: Backports of GHC deriving extensions

Copyright | (C) 2015-2017 Ryan Scott
License | BSD-style (see the file LICENSE)
Maintainer | Ryan Scott
Portability | Template Haskell
Safe Haskell | Safe-Inferred
Language | Haskell2010

Data.Eq.Deriving.Internal

Contents

- `EqClass`
- `Eq1`
- `Eq2`

Description

Exports functions to mechanically derive `EqClass`, `Eq1`, and `Eq2` 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

- deriveEq :: Name -> Q [Dec]
- makeEq :: Name -> Q Exp
- makeNotEq :: Name -> Q Exp
- deriveEq1 :: Name -> Q [Dec]
- makeLiftEq :: Name -> Q Exp
- makeEq1 :: Name -> Q Exp
- deriveEq2 :: Name -> Q [Dec]
- makeLiftEq2 :: Name -> Q Exp
- makeEq2 :: Name -> Q Exp

# `EqClass`

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

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

makeEq :: Name -> Q Exp Source #

Generates a lambda expression which behaves like `(==)` (without requiring an `EqClass` instance).

makeNotEq :: Name -> Q Exp Source #

Generates a lambda expression which behaves like `(/=)` (without requiring an `EqClass` instance).

# `Eq1`

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

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

makeLiftEq :: Name -> Q Exp Source #

Generates a lambda expression which behaves like `liftEq` (without requiring an `Eq1` instance).

This function is not available with `transformers-0.4`.

makeEq1 :: Name -> Q Exp Source #

Generates a lambda expression which behaves like `eq1` (without requiring an `Eq1` instance).

# `Eq2`

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

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

This function is not available with `transformers-0.4`.

makeLiftEq2 :: Name -> Q Exp Source #

Generates a lambda expression which behaves like `liftEq2` (without requiring an `Eq2` instance).

This function is not available with `transformers-0.4`.

makeEq2 :: Name -> Q Exp Source #

Generates a lambda expression which behaves like `eq2` (without requiring an `Eq2` instance).

This function is not available with `transformers-0.4`.