More study of GHC source code answered my question: when I generate a rule, set ru_auto to False rather than True, so that findExternalRules won't delete the rule.
On Tue, Feb 9, 2016 at 6:47 PM, Conal Elliott <co...@conal.net> wrote: > I'm writing a GHC plugin that generates new rules. The top-level > identifier for the new rules' LHSs is always the same and is imported from > another module. One of the arguments in the rule's LHSs, however, is > defined in that module. I'm creating rules and adding them to the mg_rules > of the module's ModGuts. I don't see them in the .hi files (viewed with > "ghc --show-iface Foo.hi"), and they're not getting found in modules that > import the modules where I'm trying to generate rules. Am I missing a > crucial step? For instance, do I need also to use `addIdSpecialisations` > with the argument identifiers, and if so, need I replace all instances of > those identifiers in the module or just some of them? > > > Thanks, -- Conal >
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs