
Stream Fusion, a popular deforestation technique in the Haskell community, cannot fuse the concatMap combinator. This is a serious limitation, as concatMap represents computations on nested streams. The original implementation of Stream Fusion used the Glasgow Haskell Compiler's user-directed rewriting system. A transformation which allows the compiler to fuse many uses of concatMap has previously been proposed, but never implemented, because the host rewrite system was not expressive enough to implement the proposed transformation. In this paper, we develop a custom optimization plugin which implements the proposed concatMap transformation, and study the effectiveness of the transformation in practice.We also provide a new translation scheme for list comprehensions which enables them to be optimized. Within this framework, we extend the transformation to monadic streams. Code featuring uses of concatMap experiences significant speedup when compiled with this optimization. This allows Stream Fusion to outperform its rival, foldr/build, on many list computations, and enables performance-sensitive code to be expressed at a higher level of abstraction. Categories and Subject Descriptors D.3.4 [Programming Languages]: Processors-Code generation, Compilers, Optimization General Terms Languages, Performance.
Optimization, 104022 Theoretical chemistry, Program fusion, Stream fusion, 106005 Bioinformatik, Functional programming, 104022 Theoretische Chemie, Haskell, Program transformation, Deforestation, 106005 Bioinformatics, GHC
Optimization, 104022 Theoretical chemistry, Program fusion, Stream fusion, 106005 Bioinformatik, Functional programming, 104022 Theoretische Chemie, Haskell, Program transformation, Deforestation, 106005 Bioinformatics, GHC
| selected citations These citations are derived from selected sources. This is an alternative to the "Influence" indicator, which also reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically). | 8 | |
| popularity This indicator reflects the "current" impact/attention (the "hype") of an article in the research community at large, based on the underlying citation network. | Average | |
| influence This indicator reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically). | Average | |
| impulse This indicator reflects the initial momentum of an article directly after its publication, based on the underlying citation network. | Top 10% |
