good fusion (was Re: inits)

Josef Svenningsson josef.svenningsson at gmail.com
Mon Apr 10 07:08:36 EDT 2006


On 4/10/06, Malcolm Wallace <Malcolm.Wallace at cs.york.ac.uk> wrote:
> Are the larger sizes of zipWith (zipWith3, zipWith4, ...) also good
> producers?  I have some evidence from a recent application I have been
> writing that they may not be.  At least, reading the -ddump-simpl
> output, it does not seem clear-cut that a pipeline e.g.
>     (concat . f . map g . zipWith3 h as bs) cs
> is turned into a simple loop, although perhaps I am not reading it
> right.  Is there any received wisdom on what should be expected here?
>
The GHC documentation is rather clear at this point. See:
http://www.haskell.org/ghc/docs/latest/html/users_guide/rewrite-rules.html#id3153312

The larger zipWiths are not listed as good producers, hence you cannot
expect fusion to happen.

Cheers,

/Josef


More information about the Libraries mailing list