Example usage:
import Generics.MultiRec import Generics.MultiRec.TH.Alt import Data.Tree data TheFam :: (* -> *) where TreeIntPrf :: TheFam (Tree
Int) ForestIntPrf :: TheFam (Forest
Int) $(deriveEverything
(DerivOptions
{familyTypes
= [ ( [t|Tree
Int |], "TreeIntPrf" ), ( [t|Forest
Int |], "ForestIntPrf" ) ],indexGadtName
= "TheFam",constructorNameModifier
= defaultConstructorNameModifier,patternFunctorName
= "ThePF",verbose
= True,sumMode
=Balanced
) ) type instancePF
TheFam = ThePF
- data DerivOptions = DerivOptions {
- familyTypes :: [(TypeQ, String)]
- indexGadtName :: String
- constructorNameModifier :: String -> String -> String
- patternFunctorName :: String
- verbose :: Bool
- sumMode :: SumMode
- data SumMode
- = RightNested
- | Balanced
- defaultConstructorNameModifier :: String -> String -> String
- deriveEverything :: DerivOptions -> Q [Dec]
- module Generics.MultiRec.Base
Documentation
data DerivOptions Source
DerivOptions | |
|
defaultConstructorNameModifier :: String -> String -> StringSource
Makes names like CTOR_Either_Left
, CTOR_Either_Right
etc.
deriveEverything :: DerivOptions -> Q [Dec]Source
Main function.
module Generics.MultiRec.Base