[Haskell-cafe] ByteString, zipWith', and rewrite rules

Thomas M. DuBuisson thomas.dubuisson at gmail.com
Sun Jul 11 12:15:29 EDT 2010


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'?

If I'm wrong here then the comment needs to be moved to somewhere that
will get haddockized, perhaps with zipWith.

Cheers,
Thomas



More information about the Haskell-Cafe mailing list