WIP: hsSyn: add a new GhcSe phase for representing completely serialisable ASTs
Where by serialisable, we mean in the sense of GHC's Binary
module.
This patch comes with utility functions for converting to/from GhcPs
.
The main difference with GhcPs
ASTs is the representation of names and
(syntax level) types in several places in the AST data types, which are
turned into serialisable values when converting to GhcSe
, just like a
huge majority of AST constructs.
In addition to the conversion functions, this patch adds lots of Binary
instances for AST data types that are parametrized on the phase, but only
when the phase is instantiated to GhcSe
.
This MR is based on ghc/ghc!1326 (closed) and adds another commit on top of it.
Note: there also is a haddock.diff
file at the top of the tree, which is
a haddock patch that must be applied for haddock to build properly with these
changes. I will submit it to the haddock repo soon, but it's a bit unfortunate
that the haddock patch depends on the GHC changes too, nothing will build
properly until the haddock patch lands and the submodule is updated
accordingly.