
Hi, Am Montag, den 29.05.2017, 17:28 +0200 schrieb Sebastian Graf:
Occurrence Analyzer Ahh, good thinking.
Do Unfoldings qualify in the same way?
Unfoldings are kept alive together with the thing they unfold (so that you can remove an unfolding together with its Id should that get unused). And for most analyses, it makes sense to consider them an alternative RHS, so if you have f [Unfolding = \x -> bar x] f = \x -> foo x then that is a bit like f x = case coinToss of True -> bar x False -> foo x
So, what binders do I have to consider as 'roots' apart from exports, RULEs, VECTORISE and possibly Unfoldings? That should be pretty much everything relevant, if the occurence analyser gets away with it, right?
If the occurence analyser gets away with it, then so do you :-) But Unfoldings are not roots; they are referenced by the ID they unfold. (I wonder if the same can be said for non-orphan RULES, but maybe that is just too much a corner case.) Greetings, Joachim -- Joachim “nomeata” Breitner mail@joachim-breitner.de • https://www.joachim-breitner.de/ XMPP: nomeata@joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org