What is an unfolding?

Asked by mpickering on Sep 25 2016, 3:55 AM.


This is mentioned a lot in the code to do with inlining. How is an unfolding different from the definition of a function, are they the same thing?


Updated 1,160 Days Ago

An unfolding is the expression which will be inlined in a function's call-sites. It is important to note that unfoldings are not simplified by the simplifier since this simplification may hide optimization opportunities that might arise when the unfolding is inlined into a call-site.

Unfoldings are attached to Ids in their IdInfo during desugaring by DsBinds.makeCorePair.

New Answer