
13 Feb
2015
13 Feb
'15
6:18 p.m.
On 13 February 2015 at 23:36, Simon Peyton Jones
| What's the reason that there isn't a parseExp :: String -> Q Exp, | parseDecl, etc.?
Good idea! I don't think it'd be too hard. The parser (in parser/Parser.y) already exposes parseExpression, parseDeclaration etc. But they generate HsSyn and we need TH syntax. We don’t currently have a way to do that. It's (B) in https://ghc.haskell.org/trac/ghc/wiki/TemplateHaskell/Conversions
So there's some refactoring work to do here. Fiddly but not hard.
Awesome! I wasn't sure whether I wasn't taking into account a subtle stage restriction problem somehow. Nice diagram. :-) I'm looking at the TH implementation to see whether this is something I can reasonably tackle. Cheers!