Add proper GADTs support to Template Haskell
[ghc.git] / testsuite / tests / th / TH_spliceDecl3_Lib.hs
1 module TH_spliceDecl3_Lib
2 where
3
4 import Language.Haskell.TH
5
6 rename' :: Dec -> Q [Dec]
7 rename' (DataD ctxt tyName tyvars ksig cons derivs) =
8 return [DataD ctxt (stripMod tyName) tyvars ksig
9 (map renameCons cons) derivs]
10 where
11 renameCons (NormalC conName tys) = NormalC (stripMod conName) tys
12 --
13 stripMod v = mkName (nameBase v ++ "'")