Some small optimisations, generalise the type of unfold
authorDon Stewart <dons@cse.unsw.edu.au>
Wed, 10 May 2006 04:33:09 +0000 (04:33 +0000)
committerDon Stewart <dons@cse.unsw.edu.au>
Wed, 10 May 2006 04:33:09 +0000 (04:33 +0000)
commit76180284aace6abc8647bdb120fc81032b691d6b
treec8cdef35d514e38b3a1f7c51f56317b8b99d4f7d
parenta9add2f6d9e5362e44dafb8526fe392798c3a522
Some small optimisations, generalise the type of unfold

    Tue May  9 22:36:29 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
      * Surely the error function should not be inlined.

    Tue May  9 22:35:53 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
      * Reorder memory writes for better cache locality.

    Tue May  9 23:28:09 EST 2006  Duncan Coutts <duncan.coutts@worc.ox.ac.uk>
      * Generalise the type of unfoldrN

      The type of unfoldrN was overly constrained:
      unfoldrN :: Int -> (Word8 -> Maybe (Word8, Word8)) -> Word8 -> ByteString

      if we compare that to unfoldr:
      unfoldr :: (b -> Maybe (a, b)) -> b -> [a]

      So we can generalise unfoldrN to this type:
      unfoldrN :: Int -> (a -> Maybe (Word8, a)) -> a -> ByteString

      and something similar for the .Char8 version. If people really do want to
      use it a lot with Word8/Char then perhaps we should add a specialise pragma.

    Wed May 10 13:26:40 EST 2006  Don Stewart <dons@cse.unsw.edu.au>
      * Add foldl', and thus a fusion rule for length . {map,filter,fold},
      that avoids creating an array at all if the end of the pipeline is a 'length' reduction

**END OF DESCRIPTION***

Place the long patch description above the ***END OF DESCRIPTION*** marker.
The first line of this file will be the patch name.

This patch contains the following changes:

M ./Data/ByteString.hs -8 +38
M ./Data/ByteString/Char8.hs -6 +12
Data/ByteString.hs
Data/ByteString/Char8.hs