multirec-0.3: Generic programming for families of recursive datatypesSource codeContentsIndex
Generics.MultiRec.TH
Portabilitynon-portable
Stabilityexperimental
Maintainergenerics@haskell.org
Description
This module contains Template Haskell code that can be used to automatically generate the boilerplate code for the multiplate library. The constructor information can be generated per datatype, the rest per family of datatypes.
Synopsis
deriveConstructors :: [Name] -> Q [Dec]
deriveFamily :: Name -> [Name] -> String -> Q [Dec]
deriveSystem :: Name -> [Name] -> String -> Q [Dec]
derivePF :: String -> [Name] -> Q [Dec]
deriveEl :: Name -> [Name] -> Q [Dec]
deriveFam :: Name -> [Name] -> Q [Dec]
deriveEqS :: Name -> [Name] -> Q [Dec]
Documentation
deriveConstructors :: [Name] -> Q [Dec]Source
Given a list of datatype names, derive datatypes and instances of class Constructor.
deriveFamily :: Name -> [Name] -> String -> Q [Dec]Source
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
Compatibility. Use deriveFamily instead.
derivePF :: String -> [Name] -> Q [Dec]Source
Derive only the PF instance. Not needed if deriveFamily is used.
deriveEl :: Name -> [Name] -> Q [Dec]Source
Derive only the El instances. Not needed if deriveFamily is used.
deriveFam :: Name -> [Name] -> Q [Dec]Source
Dervie only the Fam instance. Not needed if deriveFamily is used.
deriveEqS :: Name -> [Name] -> Q [Dec]Source
Derive only the EqS instance. Not needed if deriveFamily is used.
Produced by Haddock version 2.4.2