Copyright | (c) 2008--2009 Universiteit Utrecht |
---|---|
License | BSD3 |
Maintainer | generics@haskell.org |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell98 |
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.
- deriveMeta :: Name -> Q [Dec]
- deriveData :: Name -> Q [Dec]
- deriveConstructors :: Name -> Q [Dec]
- deriveSelectors :: Name -> Q [Dec]
- deriveAll :: Name -> Q [Dec]
- deriveRepresentable0 :: Name -> Q [Dec]
- deriveRep0 :: Name -> Q [Dec]
- simplInstance :: Name -> Name -> Name -> 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
.
deriveAll :: Name -> Q [Dec] Source
Given the type and the name (as string) for the type to derive,
generate the Data
instance, the Constructor
instances, the Selector
instances, and the Representable0
instance.
deriveRepresentable0 :: Name -> Q [Dec] Source
Given the type and the name (as string) for the Representable0 type
synonym to derive, generate the Representable0
instance.
deriveRep0 :: Name -> Q [Dec] Source
Derive only the Rep0
type synonym. Not needed if deriveRepresentable0
is used.