<div dir="ltr"><div>Dear Haskell-cafĂ©,<br></div><div>I am trying to write a small TH module which manipulates Haskell code. Basically, I have a function `transform :: Exp -> Q Exp` which I call this way:<br></div><div>> g = $(transform [| map (+1) [1,2,3] |])<br></div><div>Since this is a source-to-source transformation, I would like to generate also {-# LINE ... #-} pragmas to point any error back to their original location.<br></div><div>My question is: is there any way to obtain the location of sub-expressions inside a `Exp` or `Q Exp`?<br><br></div><div>Thanks in advance,<br></div><div>Alejandro<br></div></div>