generic-deriving-1.4.0: Generic programming library for generalised deriving.

Portability | non-portable
Stability | experimental
Maintainer | generics@haskell.org
Safe Haskell | None

Generics.Deriving.TH

Description

This module contains Template Haskell code that can be used to automatically generate the boilerplate code for the generic deriving library. For now, it generates only the `Generic` instance. Empty datatypes are not yet supported.

Synopsis

- deriveMeta :: Name -> Q [Dec]
- deriveData :: Name -> Q [Dec]
- deriveConstructors :: Name -> Q [Dec]
- deriveSelectors :: Name -> Q [Dec]

# Documentation

deriveMeta :: Name -> Q [Dec]Source

Given the type and the name (as string) for the type to derive, generate the `Data` instance, the `Constructor` instances, and the `Selector` instances.

deriveData :: Name -> Q [Dec]Source

Given a datatype name, derive a datatype and instance of class `Datatype`.

deriveConstructors :: Name -> Q [Dec]Source

Given a datatype name, derive datatypes and instances of class `Constructor`.

deriveSelectors :: Name -> Q [Dec]Source

Given a datatype name, derive datatypes and instances of class `Selector`.