Difference between revisions of "Short cut fusion"
Jump to navigation
Jump to search
(short explanation with the usual examples) |
(added link) |
||
Line 3: | Line 3: | ||
It can also help to remove intermediate data structures. |
It can also help to remove intermediate data structures. |
||
E.g. computing <hask>sum [1..n]</hask> does not require an explicit list structure, and the expression is actually translated into a simple loop. |
E.g. computing <hask>sum [1..n]</hask> does not require an explicit list structure, and the expression is actually translated into a simple loop. |
||
+ | |||
+ | See also [[correctness of short cut fusion]]. |
||
[[Category:Glossary]] |
[[Category:Glossary]] |
Latest revision as of 09:28, 18 January 2008
Short cut fusion is an optimizer method that merges some function calls into one.
E.g. map f . map g
can be substituted by map (f . g)
and filter p . filter q
can be substituted by filter (\x -> q x && p x)
.
It can also help to remove intermediate data structures.
E.g. computing sum [1..n]
does not require an explicit list structure, and the expression is actually translated into a simple loop.
See also correctness of short cut fusion.