[Template-haskell] What happened to currentLoc ?

Alfonso Acosta alfonso.acosta at gmail.com
Wed Oct 24 17:46:16 EDT 2007


Hi,

I've been trying to improve error reporting in my TH-based embedded
compiler. I sometimes build data structures using splices. Those
structures can later cause an error at runtime which, to be more
informative, should give the line and module in which the splice was
executed (i.e. tell to what structure the error refering by telling
where it was exactly created)

I have just read about currentLoc in the "Notes on Template Haskell 2"
document.

currentLoc :: Q (FilePath, Int)

  -- Returns the location of the top-level splice being executed.

Was it ever implemented? Are there any plans to do it?

The path to the module is not really important (it should be enough
with currentModule) but the line information can be really helpful.

Thanks,

Fons


More information about the template-haskell mailing list