@@ -547,18 +547,20 @@ foldr1 :: (Char -> Char -> Char) -> Text -> Char
547foldr1 f t = S.foldr1 f (stream t)
547foldr1 f t = S.foldr1 f (stream t)
548{-# INLINE foldr1 #-}
548{-# INLINE foldr1 #-}
550−-- | /O(n)/ Concatenate a list of 'Text's. Subject to array fusion.
550+-- | /O(n)/ Concatenate a list of 'Text's.
551concat :: [Text] -> Text
551concat :: [Text] -> Text
552−concat ts = unstream (S.concat (L.map stream ts))
552+concat = to
554+ go Empty css = to css
555+ go (Chunk c cs) css = Chunk c (go cs css)
557+ to (cs:css) = go cs css
553{-# INLINE concat #-}
558{-# INLINE concat #-}
555-- | /O(n)/ Map a function over a 'Text' that results in a 'Text', and
560-- | /O(n)/ Map a function over a 'Text' that results in a 'Text', and
556−-- concatenate the results. This function is subject to array fusion.
561+-- concatenate the results.
558−-- Note: if in 'concatMap' @f@ @t@, @f@ is defined in terms of fusible
559−-- functions, it will also be fusible.
560concatMap :: (Char -> Text) -> Text -> Text
562concatMap :: (Char -> Text) -> Text -> Text
561−concatMap f t = unstream (S.concatMap (stream . f) (stream t))
563+concatMap f = concat . foldr ((:) . f) []
562{-# INLINE concatMap #-}
564{-# INLINE concatMap #-}
564-- | /O(n)/ 'any' @p@ @t@ determines whether any character in the
566-- | /O(n)/ 'any' @p@ @t@ determines whether any character in the