Skip to content

Make Hooks overridable by compiler plugins

Alp Mestanogullari requested to merge alp/ghc:wip/alp/hooks-plugin into master

We do so with a new field in the Plugin data type, which lets plugin authors supply a Hooks -> Hooks function that then gets applied to the hooks already present in the DynFlags. If several plugins override the hooks, we compose all the corresponding Hooks -> Hooks functions.

The patch also comes with a test that overrides the Meta hook, returning 0 for all expression splices instead of running TH to "compute" the actual value.

Edited by Alp Mestanogullari

Merge request reports