<div dir="ltr"><div><div><div><div><div><div><div><div><div>This is a heads up that D3609[1], the first step toward implementing Trees that Grow[2] for the hsSyn AST is about to land in master.<br><br></div>The key change is that it is replacing the HsSyn type parameter with one that is an index into a set of type families, enabling the extension points (for a future diff).<br><br></div>Any current work in progress branches will need a one-time search and replace of all type parameters as follows<br><br></div>RdrName  -> GhcPs<br></div>Name  -> GhcRs<br></div>Var -> GhcTc<br></div>Id -> GhcTcId<br><br><br></div>Any code that makes use of the GHC API and needs to compile with earlier versions too can do something like<br><br>      #if MIN_VERSION_ghc(8,3,0)<br>      type ParseI     = GhcPs<br>      type RenameI    = GhcRn<br>      type TypecheckI = GhcTc<br>      #else<br>      type ParseI     = RdrName<br>      type RenameI    = Name<br>      type TypecheckI = Var<br>      #endif<br><br></div>and then replace the RdrName / Name / Var type params with ParseI / RenameI / TypecheckI.<br><br></div>A real world example is in ghc-exactprint[3] <br><div><div><div><div><div><div><div><div><div><div><br>Regards<br></div><div>  Alan<br><br></div><div>[1] <a href="https://phabricator.haskell.org/D3609">https://phabricator.haskell.org/D3609</a><br>[2] <a href="https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow">https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow</a><br>[3] <a href="https://github.com/alanz/ghc-exactprint/commit/6a6e3cdeb40f9623e9a7fc6f1be90da981cb921b">https://github.com/alanz/ghc-exactprint/commit/6a6e3cdeb40f9623e9a7fc6f1be90da981cb921b</a><br></div></div></div></div></div></div></div></div></div></div></div>