Problem
Is it possible to generate "pure" Haskell code out of the one including Template Haskell functions?
I want to get the code where all Haskell Template's qutations and splices are expanded? (to feed it into another Haskell compiler (Haste), which does not support Template Haskell yet.)
Example
module TupleReplicate:
tupleReplicate n = do
id <- newName "x"
return $ LamE ([VarP id]) (TupE $ replicate n $ VarE id)
main:
main :: IO ()
main = do
print $(tupleReplicate 3) "x"
return ()
can be expanded to:
main :: IO ()
main = do
print (\x->(x,x,x)) "x"
return ()