Move AST into it's own package
Motivation
The end goal of TTG is to share extensible data types for Haskell's syntax between GHC and other projects. But if we are to do that, we should have those data types live in a separate package.
- This is more robust at preventing entanglement than e.g. "the parser dependencies test"
- Eventually things might stabilize enough that the base extensible AST doesn't have a breaking change every GHC release. That mean less churn on PVP bounds for consumers of just the AST and not the rest of GHC.
- Hopefully, this can be the beginning of modularizing GHC more broadly :).
The relevant TTG wiki page is here
Proposal
The big question is of course how we get there. The key trick is to do work getting ready to separate the AST into it's own package before actually doing it, because its too much of a refactor to do all at once.
- #18936 (closed) This talks about how to remove a major part of the GHC-specific stuff from the module
- In !4778 (comment 323748) @SPJ talks about using a different module hierarchy to indicate to other programmers the intent for these modules tot be separate from GHC. I think that's a great idea.