PUBLIC
Hi,
I’m looking for ways to map Core fragments back to source locations.
I see there is an annotated version of Core in `GHC/Core.hs` called `AnnExpr`, which I could see being useful for this if I set the annotation type to `SrcSpan`, but that’s not
what I get out of GHC’s desugarer, simplifier or tidier.
If there’s no built-in mechanism for this, my only idea would be to create a HsExpr-to-HsExpr transformation that wraps every node in a call that is opaque enough to be persisted
through Core-to-Core transformations but still transparent enough that it doesn’t block optimization opportunities. Is that even possible?
Alternatively, would it make it easer if I was content with only getting source locations for variable occurrences?
Thanks,
Gergo