I've got a Module (Language.Haskell.Exts.Syntax.Module
) and want to turn it into a template haskell data structure. How can I go about it? My first confusion is that the Module
type from Language.Haskell.TH.Syntax
doesn't look like a representation of a haskell module (it only has a PkgName
and a ModName
). So what's equivalent to Language.Haskell.Exts.Syntax.Module
in template haskell? Is there a way to convert between the two?
Asked
Active
Viewed 50 times
0

rem
- 893
- 4
- 18
-
"So what's equivalent to Language.Haskell.Exts.Syntax.Module in template haskell?" There is none, it simply doesn't support it. You cannot splice an entire module (at least yet). – user2407038 Nov 02 '15 at 13:49
-
Is there a reason for that? – rem Nov 02 '15 at 14:29
-
I would assume that it is a majour technical challenge, and there hasn't been much demand for it. I don't know how it would even work - you can't have a module inside a module. – user2407038 Nov 02 '15 at 14:43
-
That makes sense. If you put your first comment as an answer I will accept it. – rem Nov 02 '15 at 14:54
1 Answers
1
There is no equivalent to Language.Haskell.Exts.Syntax.Module
in Template Haskell, it simply doesn't support it. You cannot splice an entire module (at least yet).

user2407038
- 14,400
- 3
- 29
- 42