Plugins: Accessing unexported bindings
Edward Z. Yang
ezyang at mit.edu
Sun Dec 6 08:31:16 UTC 2015
If you have control over the Ids for the properties, if you can
arrange for them to be marked "local exported" that should solve
your problem.
Edward
Excerpts from Levent Erkok's message of 2015-12-05 23:01:29 -0800:
> Hello,
>
> The mg_binds field of the ModGuts seem to only contain the bindings that
> are exported from the module being compiled.
>
> I guess GHC must be running user-plugins after it drops the bindings that
> are not exported, which makes perfect sense for most use cases. However,
> I'm working on a plugin where the end-programmer embeds "properties" in the
> form of functions inside his/her code, which are not necessarily exported
> from the module under consideration.
>
> Is there a way to access all top-level bindings in a module from a plugin,
> even if those bindings are not exported?
>
> Thanks,
>
> -Levent.
More information about the ghc-devs
mailing list