I know that:
- Function inlining is to replace a function call with the function definition.
- Partial evaluation is to evaluate the known (static) parts of a program at compile time.
There is a distinction between the two in imperative languages like C, where operators are distinct from functions. However, is there any difference between the two in functional languages like Haskell where operators are functions too?
Is the only difference between the two that function inlining can be performed on selective parts of a program whereas partial evaluation is performed on the entire program (i.e. ∃
vs ∀
)?
What are the semantic differences between the two optimization techniques?