What is an unfolding?
OpenPublic

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

Details

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?

Answers

bgamari
Updated 1,027 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