[Haskell-cafe] Is fusion overrated?

Roman Leshchinskiy rl at cse.unsw.edu.au
Wed May 18 10:11:54 CEST 2011


Roman Cheplyaka wrote:
>
> Of course I don't claim that fusion is useless -- just trying to
> understand the problem it solves. Are we saving a few closures and cons
> cells here?

In addition to what everyone else said, fusion can be a big win when it
allows further optimisations. For instance, fusing map (+1) . map (+2) can
eliminate 1 addition per iteration. Even without taking allocation into
account, most of the reasons for why loop fusion is a worthwhile
optimisation in C apply to Haskell, too!

Roman






More information about the Haskell-Cafe mailing list