multirec-alt-deriver-0.1.2: Alternative multirec instances deriver



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 :: String

Name of the family GADT (this type has to be generated manually because TH doesn't support GADTs yet)

constructorNameModifier :: String -> String -> String

Scheme 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 :: String

Name of the pattern functor (PF) to generate

verbose :: Bool

Print various informational messges?