Closed plaidfinch closed 8 years ago
The TcPluginM
module of the GHC API now exports newWanted
/newGiven
/newDerived
functions that should help here. You might also be interested in ghc-tcplugins-extra, which is intended to contain common functionality for plugins and to paper over the differences between different versions of the GHC API.
Works perfectly; thanks @adamgundry. I just submitted a pull request with this patch.
In attempting to compile the plugin for GHC HEAD, I get only one compile error, for the function
mkNewFact
:The problem is that the
ctev_evtm
field of theCtGiven
constructor on theCtEvidence
type has changed; it is nowctev_evar
, of typeEvVar
, while it used to be of typeEvTerm
. I believe this is due to changes in the constraint solver architecture for GHC 8.0—@goldfirere would know more about this, I'm pretty sure.In any case, we need to find a way to shoe-horn the manufactured evidence into an
EvVar
now. I'm not sure which bits of theEvVar
infrastructure should be used to replicate the previous behavior; any ideas?