Implement TH addCorePlugin.

Authored by facundominguez on Aug 4 2017, 2:59 PM.



This allows template-haskell code to add plugins to the compilation
pipeline. Otherwise, the user would have to pass -fplugin=... to ghc.

For now, plugin modules in the current package can't be used. This is
because when TH runs, it is too late to let GHC know that the plugin
modules needed to be compiled first.

Test Plan


Diff Detail

rGHC Glasgow Haskell Compiler
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
facundominguez created this revision.Aug 4 2017, 2:59 PM
bgamari requested changes to this revision.Aug 18 2017, 7:51 AM

Looks fairly reasonable to me.

Can you add a mention of this in the plugins section of the users guide?


Do you get a reasonable error message if the plugin belongs to the current package?

This revision now requires changes to proceed.Aug 18 2017, 7:51 AM
facundominguez added inline comments.Aug 18 2017, 9:16 AM

The implementation of qAddCorePlugin raises

addCorePlugin: invalid plugin module <module>
Plugins in the current package can't be specified.
facundominguez edited edge metadata.
  • Mention addCorePlugin in the user guide.
bgamari accepted this revision.Sep 21 2017, 4:21 PM

Looks good to me.

This revision is now accepted and ready to land.Sep 21 2017, 4:21 PM
This revision was automatically updated to reflect the committed changes.