We don't use much of GHC API, so it shouldn't be that hard. But if some API changes, I propose to handle this in the following way:
Create Stan.Hie.Compat with CPP around relevant functions to work with HIE. Ideally, the implementations of functions from different GHC versions are allowed to be different, but the types should be the same whenever it's possible to achieve it, so we can use them in other modules and have CPP only in Stan.Hie.Compat.
Optionally, if some other parts of GHC change, create the Stan.Ghc (or Stan.Ghc.Compat) module and do the same as for Stan.Hie.Compat.
I hope that none of this will be required since we don't use unstable parts of the GHC API. But it's a plan to keep in mind.
We don't use much of GHC API, so it shouldn't be that hard. But if some API changes, I propose to handle this in the following way:
Stan.Hie.Compat
withCPP
around relevant functions to work with HIE. Ideally, the implementations of functions from different GHC versions are allowed to be different, but the types should be the same whenever it's possible to achieve it, so we can use them in other modules and have CPP only inStan.Hie.Compat
.Stan.Ghc
(orStan.Ghc.Compat
) module and do the same as forStan.Hie.Compat
.I hope that none of this will be required since we don't use unstable parts of the GHC API. But it's a plan to keep in mind.