regular-0.3.0: Generic programming library for regular datatypes.

Portabilitynon-portable
Stabilityexperimental
Maintainergenerics@haskell.org

Generics.Regular.TH

Description

This module contains Template Haskell code that can be used to automatically generate the boilerplate code for the regular library.

Synopsis

Documentation

deriveAll :: Name -> String -> Q [Dec]Source

Given the type and the name (as string) for the pattern functor to derive, generate the Constructor' instances, the Selector' instances and the Regular instance.

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.

deriveRegular :: Name -> String -> Q [Dec]Source

Given the type and the name (as string) for the pattern functor to derive, generate the Regular instance.

derivePF :: String -> Name -> Q [Dec]Source

Derive only the PF instance. Not needed if deriveRegular is used.