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
  [email protected]https://www.joachim-breitner.de/
  XMPP: [email protected] • OpenPGP-Key: 0xF0FBF51F
  Debian Developer: [email protected]

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

_______________________________________________
ghc-devs mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Reply via email to