<div dir="ltr"><div><div>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.<br><br></div>In addition, the hsSyn AST for each will have different TTG[1] annotations, so that it can better support IDE usage.<br><br></div><div>I think this can be done by changing the types in HsExtension to introduce a 'Process'  type as follows<br><br>data Pass = Parsed Process | Renamed | Typechecked<br>         deriving (Data)<br><br>data Process = Batch | Interactive<br>  deriving (Show, Data)<br><br></div><div>We then rename the pass synonyms so that batch is the default<br><br>type GhcPs   = GhcPass ('Parsed 'Batch)<br>type GhcPsI  = GhcPass ('Parsed 'Interactive)<br><br></div><div>I have attached a simple proof of concept file, which emulates parsing and renaming.<br><br></div><div>Is this an appropriate approach to take?<br><br></div><div>Alan<br><br></div><div><br></div>[1] Trees That Grow <a href="https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow" target="_blank">https://ghc.haskell.org/trac/<wbr>ghc/wiki/<wbr>ImplementingTreesThatGrow</a><br></div>