# generic-deriving

> Generic programming library for generalised deriving in Haskell

Source: https://talira.ai/catalog/generic-deriving-x1bhjkjw
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [developer tools / code generation](https://talira.ai/categories/developer-tools/code-generation), [languages / haskell](https://talira.ai/categories/languages/haskell)
- Licence: BSD-3-Clause[^1][^2]
- Pricing: Free and open source[^2]
- Free tier: yes[^2]
- Backed by: [José Pedro Magalhães](https://talira.ai/orgs/jose-pedro-magalhaes.md)

generic-deriving generalises [Haskell](https://talira.ai/catalog/haskell-jjq1dx6f.md)'s deriving mechanism to arbitrary classes, building on GHC Generics; it was first described in the Haskell'10 paper "A generic deriving mechanism for Haskell" by José Pedro Magalhães, Atze Dijkstra, Johan Jeuring and Andres Löh. It backports parts of GHC.Generics to older compilers, derives `Generic` and `Generic1` instances with Template Haskell, and includes example classes with generic defaults (equality, show, functor, foldable and others) meant mainly for teaching.

## Links

- GitHub: https://github.com/dreixel/generic-deriving

## Problems it solves

- derive Generic instances with Template Haskell
- write generic default methods for a Haskell type class
- support GHC Generics on older GHC versions

## Features

- GHC.Generics backports for older compilers
- Template Haskell deriving of Generic and Generic1
- example generic default implementations

## Limitations

- Its example classes (GShow, GEq and others) are for teaching and aren't drop-in replacements for the standard classes.[^1]

## Trust

Overall: 0.26 out of 1.
Signals: maintenance 0.27, adoption 0.33, momentum 0.03, community 0.51, backing 0.30, extensibility 0.00.

- 45 GitHub stars
- 18 contributors
- backed by José Pedro Magalhães

Warnings:

- last commit 5 months ago

## Alternatives

- [th-lift](https://talira.ai/catalog/th-lift-24br7pf5.md): Derive Template Haskell's Lift class for datatypes
- [th-abstraction](https://talira.ai/catalog/th-abstraction-ebd79nxp.md): One interface to Template Haskell's datatype information across GHC versions

## Sources

[^1]: https://github.com/dreixel/generic-deriving/blob/master/generic-deriving.cabal (checked 29 Nov 2026)
[^2]: https://github.com/dreixel/generic-deriving/blob/master/LICENSE (checked 29 Nov 2026)
