<div dir="ltr">Hi Richard,<div><br></div><div>I've introduced tyVarsOfTypeAcc recently and the main reason was to get deterministic order (part of #4012) of free variables in places that require it, like abstracting type variables when floating out expressions. It does a bit more than tyVarsOfType, but it's algorithmically better (it avoids set union) and in the end it comes out about equal in terms of performance on GHC tests.<br><br>The reason for eta-expanding is performance, and I wrote a note [1] about it.</div><div>I've also run some isolated benchmarks [2] if you're interested.<br><br></div><div>[1] <a href="https://phabricator.haskell.org/diffusion/GHC/browse/master/compiler/utils/FV.hs;43a31fe4c0cc0f72dfe9e0c96e1576f5cfba6e19$105-140">https://phabricator.haskell.org/diffusion/GHC/browse/master/compiler/utils/FV.hs;43a31fe4c0cc0f72dfe9e0c96e1576f5cfba6e19$105-140</a></div><div class="gmail_extra">[2] <a href="https://github.com/niteria/deterministic-fvs/">https://github.com/niteria/deterministic-fvs/</a></div><div class="gmail_extra"><br></div><div class="gmail_extra">Cheers,</div><div class="gmail_extra">Bartosz</div><div class="gmail_extra"><br><div class="gmail_quote">2015-12-03 18:43 GMT+00:00 Richard Eisenberg <span dir="ltr"><<a href="mailto:eir@cis.upenn.edu" target="_blank">eir@cis.upenn.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi devs,<br>
<br>
I'm (once again) merging master into my type=kind branch. I see that we now have tyVarsOfTypeAcc :: Type -> FV, distinct from tyVarsOfType :: Type -> TyVarSet. I trust that this new version is more performant. However, I have a question: in the implementation of these functions, the three extra FV parameters (fv_cand in_scope acc) are bound and passed each time.<br>
<br>
Why?<br>
<br>
I've always understood that eta-reducing in function definitions is better than expanding. Or is this just a style choice?<br>
<br>
Thanks,<br>
Richard<br>
_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
</blockquote></div><br></div></div>