instant-generics-0.2: Generic programming library with a sum of products view




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



deriveAll :: Name -> Q [Dec]Source

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

deriveConstructors :: Name -> Q [Dec]Source

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

deriveRepresentable :: Name -> Q [Dec]Source

Given the type and the name (as string) for the Representable type synonym to derive, generate the Representable instance.

deriveRep :: Name -> Q [Dec]Source

Derive only the Rep type synonym. Not needed if deriveRepresentable is used.

simplInstance :: Name -> Name -> Name -> Name -> Q [Dec]Source

Given the names of a generic class, a type to instantiate, a function in the class and the default implementation, generates the code for a basic generic instance.