blob: bc1c26819744e800096dfd176f3fc8df177eedfe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
module TH_spliceDecl3_Lib
where
import Language.Haskell.TH
rename' :: Dec -> Q [Dec]
rename' (DataD ctxt tyName tyvars ksig cons derivs) =
return [DataD ctxt (stripMod tyName) tyvars ksig
(map renameCons cons) derivs]
where
renameCons (NormalC conName tys) = NormalC (stripMod conName) tys
--
stripMod v = mkName (nameBase v ++ "'")
|