
10 Apr
2006
10 Apr
'06
7:08 a.m.
On 4/10/06, Malcolm Wallace
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#i... The larger zipWiths are not listed as good producers, hence you cannot expect fusion to happen. Cheers, /Josef