Lets say I have a custom quasiquote, named xpto:
[xtpo|data Something = Abc | Def deriving (Eq,Ord,Show,Enum,Bounded)|]
I want to actually declare this as it is, but additionally derive some more stuff based on the constructor names. That last part is done (function generateDataDefs, irrelevant here), but I am doing inclusion of the original declaration through haskell-src-meta, which seems like quite an heavy dependency. Like this:
xpto = QuasiQuoter { quoteDec = either (const . return $ []) generateDataDefs
. parseDecs }
Can I avoid using parseDecs and just use Template Haskell instead?
PS: the function generateDataDefs takes the received [Dec], and appends the new code to it:
generateDataDefs :: [Dec] -> Q [Dec]
generateDataDefs decData = let
(...)
in return $ decData ++ remainingStuff