Printer Friendly
Dictionary, Encyclopedia and Thesaurus - The Free Dictionary
1,738,497,241 visitors served.
forum mailing list For webmasters
?
New: Language forums
Dictionary/
thesaurus
Medical
dictionary
Legal
dictionary
Financial
dictionary
Acronyms
 
Idioms
Encyclopedia
Wikipedia
encyclopedia
?

fully lazy lambda lifting

    0.02 sec.
fully lazy lambda lifting - John Hughes's optimisation of lambda lifting to give full laziness. Maximal free expressions are shared to minimise the amount of recalculation. Each inner sub-expression is replaced by a function of its maximal free expressions (expressions not containing any bound variable) applied to those expressions. E.g.

f = \ x . (\ y . (+) (sqrt x) y)

((+) (sqrt x)) is a maximal free expression in (\ y . (+) (sqrt x) y) so this inner abstraction is replaced with

(\ g . \ y . g y) ((+) (sqrt x))

Now, if a partial application of f is shared, the result of evaluating (sqrt x) will also be shared rather than re-evaluated on each application of f. As Chin notes, the same benefit could be achieved without introducing the new higher-order function, g, if we just extracted out (sqrt x).

This is similar to the code motion optimisation in procedural languages where constant expressions are moved outside a loop or procedure.


How to thank TFD for its existence? Tell a friend about us, add a link to this page, add the site to iGoogle, or visit webmaster's page for free fun content.
?Page tools
Printer friendly
Cite / link
Email
Feedback
? Mentioned in
 
Encyclopedia browser? ? Full browser
 
 
Encyclopedia
?

Disclaimer | Privacy policy | Feedback | Copyright © 2009 Farlex, Inc.
All content on this website, including dictionary, thesaurus, literature, geography, and other reference data is for informational purposes only. This information should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional. Terms of Use.