
13 Jul
2010
13 Jul
'10
7:39 a.m.
Thomas M. DuBuisson wrote:
Comments on the zipWith' function inside of Data.ByteString say:
-- Rewrite rules -- are used to automatically covert zipWith into zipWith' when a pack is -- performed on the result of zipWith.
This is only true internally to Data.ByteString because the zipWith' function could be inlined away by GHC once that module is compiled, right? If I want "pack (zipWith xor bs1 bs2)" to be efficient then I'll have to either get zipWith' exported or write my own lower level zipWith'?
As far as I know GHC prefers RULES to INLINE, but it's fragile. You may check with -ddump-simpl-stat.