{-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE FlexibleInstances #-} module ASTTHUse where import Generics.MultiRec.Elems.None import Generics.MultiRec.TH import AST -- * Instantiating the library for AST using TH -- ** Index type data AST :: (* -> *) -> * -> * -> * where Expr :: AST NoElems Expr Zero Decl :: AST NoElems Decl (Suc Zero) Var :: AST NoElems Var (Suc (Suc Zero)) -- ** Constructors $(deriveConstructors [''Expr, ''Decl, ''Var]) -- ** Functor encoding and 'Ix' instances $(deriveSystem ''AST [''Expr, ''Decl, ''Var] "PFAST") type instance PF AST = PFAST