
I want to be able to run the GHC parser in one of two modes, batch which functions as now, and interactive which will (eventually) be incremental. In addition, the hsSyn AST for each will have different TTG[1] annotations, so that it can better support IDE usage. I think this can be done by changing the types in HsExtension to introduce a 'Process' type as follows data Pass = Parsed Process | Renamed | Typechecked deriving (Data) data Process = Batch | Interactive deriving (Show, Data) We then rename the pass synonyms so that batch is the default type GhcPs = GhcPass ('Parsed 'Batch) type GhcPsI = GhcPass ('Parsed 'Interactive) I have attached a simple proof of concept file, which emulates parsing and renaming. Is this an appropriate approach to take? Alan [1] Trees That Grow https://ghc.haskell.org/trac/ghc/wiki/ ImplementingTreesThatGrow