Copyright | (c) 2008--2010 Universiteit Utrecht |
---|---|
License | BSD3 |
Maintainer | generics@haskell.org |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
This module contains Template Haskell code that can be used to automatically generate the boilerplate code for the multirec library. The constructor information can be generated per datatype, the rest per family of datatypes.
- deriveAll :: Name -> Q [Dec]
- deriveConstructors :: [Name] -> Q [Dec]
- deriveFamily :: Name -> [Name] -> String -> Q [Dec]
- deriveSystem :: Name -> [Name] -> String -> Q [Dec]
- derivePF :: String -> [Name] -> Q [Dec]
- deriveEl :: Name -> [Name] -> [(Name, [Name])] -> Q [Dec]
- deriveFam :: Name -> [Name] -> [Name] -> Q [Dec]
- deriveEqS :: Name -> [Name] -> [Name] -> Q [Dec]
Documentation
deriveConstructors :: [Name] -> Q [Dec] Source
Given a list of datatype names, derive datatypes and
instances of class Constructor
. Not needed if deriveAll
is used.
deriveFamily :: Name -> [Name] -> String -> Q [Dec] Source
Deprecated: Use deriveAll instead.
Compatibility. Use deriveAll
instead.
Given the name of the index GADT, the names of the
types in the family, and the name (as string) for the
pattern functor to derive, generate the Ix
and PF
instances. IMPORTANT: It is assumed that the constructors
of the GADT have the same names as the datatypes in the
family.
deriveSystem :: Name -> [Name] -> String -> Q [Dec] Source
Deprecated: Use deriveFamily instead
Compatibility. Use deriveAll
instead.