diff options
author | Facundo DomÃnguez <facundo.dominguez@tweag.io> | 2017-09-21 18:04:56 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-09-21 20:13:04 -0400 |
commit | 175586908963a6d438cf3c28922a38191f4eaa66 (patch) | |
tree | c481ea2193d5b15aba917e201869ba0772510dec /docs | |
parent | a9d417dab21e0b677f13c2ba99244162a8fffe3e (diff) | |
download | haskell-175586908963a6d438cf3c28922a38191f4eaa66.tar.gz |
Implement TH addCorePlugin.
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: ./validate
Reviewers: simonpj, bgamari, austin, goldfire
Reviewed By: bgamari
Subscribers: angerman, rwbarton, mboes, thomie
GHC Trac Issues: #13608
Differential Revision: https://phabricator.haskell.org/D3821
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/extending_ghc.rst | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/users_guide/extending_ghc.rst b/docs/users_guide/extending_ghc.rst index e9543ebce5..8af5989022 100644 --- a/docs/users_guide/extending_ghc.rst +++ b/docs/users_guide/extending_ghc.rst @@ -230,6 +230,18 @@ would invoke GHC like this: Linking Test ... $ +Alternatively, core plugins can be specified with Template Haskell. + +:: + + addCorePlugin "Foo.Plugin" + +This inserts the plugin as a core-to-core pass. Unlike `-fplugin=(module)`, +the plugin module can't reside in the same package as the module calling +:th-ref:`Language.Haskell.TH.Syntax.addCorePlugin`. This way, the +implementation can expect the plugin to be built by the time +it is needed. + Plugin modules live in a separate namespace from the user import namespace. By default, these two namespaces are the same; however, there are a few command line options which |