[RFC] TcPlugin changes in GHC 9.4: what would you like to see?

Sam Derbyshire sam.derbyshire at gmail.com
Mon Aug 23 09:41:15 UTC 2021


Hi all,

As you may recall, the API for type-checking plugins is changing (ever so
slightly) in GHC 9.4. It was pointed out to me that this might be a good
opportunity to make further changes to accommodate other needs of
type-checking plugin authors.

For the moment, I have one concrete change in mind: changing the
TcPluginSolveResult datatype to be a flat record, where one can separately
return solved constraints, new constraints and insoluble constraints. This
allows plugin authors to return contradictions at the same time as they
return solved constraints, which (I have been told) can significantly
improve the quality of the error messages.
Pattern synonyms can be provided for compatibility, so the impact to plugin
authors should be very minimal.

I would love to hear other suggestions for improvements. Note however that
I believe it is best if we keep the GHC API quite sparse, leaving more
elaborate design choices to libraries.

Thanks,

Sam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20210823/a0e42723/attachment.html>


More information about the ghc-devs mailing list