Skip to content

Use updated definition of XRec from #17587 to implement modular, extensible handling of source locations in the AST

Instead of Located (HsExpr p) or similar types, we should have XRec p (HsExpr p)

XRec allows annotating certain points in the AST with extra information. This maybe be source spans (for GHC), nothing (for TH), types (for HIE files), api annotations (for exactprint) or anything else.

This should hopefully bring us one step closer to sharing the AST between GHC and TH.

Wiki page: https://gitlab.haskell.org/ghc/ghc/-/wikis/implementing-trees-that-grow/handling-source-locations

This is implemented along with #17587 (closed) in !3428 (closed)

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information