Am Freitag, den 13.01.2017, 20:27 +1100 schrieb Erik de Castro Lopo:
> Michael Snoyman wrote:
> > Could be I'm misunderstanding, but are you looking for -ddump-rule-
> > firings?
> Wasn't aware of that, but my question was a little more general.
> If I write a library that includes rewrite rules, how can I ensure
> that they fire in client code that someone else writes? What
> guarantees (however loose) are there?

very little. The best one can do right now is to know enough about Core
and the inliner to predict when things are going to be inlined and when
not, what else can go wrong (wrappers maybe?), add the necessary
controls (`NOINLINE [0]` etc.), and then hope for the best. And track
down any instances of failed rewriting that you learn about.

You might also be able to set up your code so that it fails (at
runtime, with error) if the desired rules did not fire. This would be
nicer if we had https://ghc.haskell.org/trac/ghc/ticket/9180.

You can also ask for review if it is public code.


Joachim “nomeata” Breitner
  m...@joachim-breitner.de • https://www.joachim-breitner.de/
  XMPP: nome...@joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F
  Debian Developer: nome...@debian.org

Attachment: signature.asc
Description: This is a digitally signed message part

Glasgow-haskell-users mailing list

Reply via email to