
12 Apr
2002
12 Apr
'02
9:52 a.m.
Saswat Anand
Could you explain when the compiler inserts _apply1 and _apply2.
These are inserted during lambda-lifting, to ensure the correct laziness of certain applications.
As _apply2 f a b = _apply1 (_apply1 f a) b, how is _apply2 useful?
Evaluating _apply2 f a b is slightly more efficient at runtime than evaluating the nested application _apply1 (_apply1 f a) b Time profiling shows that, for many programs, _apply1 and _apply2 take a significant percentage of the total runtime, so it is wise to avoid extra runtime costs wherever possible, since their only purpose is to introduce a lazy suspension for semantic correctness. Regards, Malcolm