<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">Hi Matthew, Andreas, Ben</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">In GHC today there is a strange inconsistency:</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><ul><li>Bindings for data constructor wrappers and class method selectors are added at the end of CoreTidy.</li><li>Bindings for data constructor workers are added at the start of CorePrep</li></ul><div>This is deeply strange.  In !<a href="https://gitlab.haskell.org/ghc/ghc/-/merge_requests/10479">10479 (unary class patch)</a> I had to make some changes in this area and after being baffled I moved all these implicit bindings to one place at the start of CorePrep.  That is simpler and neater.  There is no reason for them to be separate.</div><div><br></div><div>BUT I find that one thing happens between Tidy and Prep, namely late-cost-centre injection.  That means we will no longer get late-cost-centres for data constructor wrappers and class method selectors.  I think that this is what is causing diffs in the output for callstack001 and friends in !10479.</div><div><br></div><div>I think that this is perfectly fine, and I propose to accept the changes. <br></div><div><br></div><div>Another alternative would be to inject all of these bindings at the end of Tidy (instead of the start of Prep),  But it's much nicer at the start of Prep -- we don't want any of these bindings to appear  in interface files.</div><div><br></div><div>Can you confirm that the change is ok?  Thanks</div><div><br></div><div>Simon</div></div></div>