multirec-alt-deriver-0.1: Alternative multirec instances deriverSource codeContentsIndex

Example usage:

import Generics.MultiRec
import Generics.MultiRec.TH.Alt
import Data.Tree

data TheFam :: (* -> *) where
              Tree_Int   :: TheFam   (Tree Int)
              Forest_Int :: TheFam (Forest Int)

   [ ( [t| Tree   Int |],   "Tree_Int" )
   , ( [t| Forest Int |], "Forest_Int" )
   (\t c -> "CONSTRUCTOR_" ++ t ++ "_" ++ c)

type instance PF TheFam = ThePF
data DerivOptions ft Source
familyTypes :: ft

A list of:

 (type quotation, name of corresponding constructor of the family GADT)

This defines our mutually recursive family. The types must resolve to datatypes or newtypes of kind * (type synonyms will be expanded).

indexGadtName :: StringName of the family GADT (this type has to be generated manually because TH doesn't support GADTs yet)
constructorNameModifier :: String -> String -> StringScheme for producing names for the empty types corresponding to constructors. The first arg is the name of the type (as given in familyTypes), the second arg is the name of the constructor (builtins will be called: NIL, CONS, TUPLE2, TUPLE3 ...)
patternFunctorName :: StringName of the pattern functor (PF) to generate
verbose :: BoolPrint various informational messges?
show/hide Instances
deriveEverything :: DerivOptions [(TypeQ, String)] -> Q [Dec]Source
Produced by Haddock version 2.4.2