Short cut fusion
From HaskellWiki
(Difference between revisions)
(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]] | ||
[[Category:Program transformation]] | [[Category:Program transformation]] | ||
Current revision
Short cut fusion is an optimizer method that merges some function calls into one.
E.g.map f . map g
map (f . g)
filter p . filter q
filter (\x -> q x && p x)
It can also help to remove intermediate data structures.
E.g. computingsum [1..n]
See also correctness of short cut fusion.
