The Haskell Unfolder Episode 22: foldr-build fusion
The Haskell Unfolder Episode 22: foldr-build fusion
well-typed.com The Haskell Unfolder Episode 22: foldr-build fusion
When composing several list-processing functions, GHC employs an optimisation called foldr-build fusion. Fusion combines functions in such a way that any intermediate lists can often be eliminated completely. In this episode, we will look at how this optimisation works, and at how it is implemented ...
![The Haskell Unfolder Episode 22: foldr-build fusion](https://lemmy.blahaj.zone/pictrs/image/c0f5458d-2486-4047-a641-495b3fcd9478.jpeg?format=webp&thumbnail=256)
When composing several list-processing functions, GHC employs an optimisation called foldr-build fusion. Fusion combines functions in such a way that any intermediate lists can often be eliminated completely. In this episode, we will look at how this optimisation works, and at how it is implemented in GHC: not as built-in compiler magic, but rather via user-definable rewrite rules.
0
comments