on master help sign in
Make concat and concatMap inline-friendly.
e91c827Bryan O'Sullivan
Data/Text/Fusion/Common.hs+2
@@ -481,11 +481,13 @@ intercalate s = concat . (L.intersperse s)
481-- | /O(n)/ Concatenate a list of streams. Subject to array fusion.
481-- | /O(n)/ Concatenate a list of streams. Subject to array fusion.
482concat :: [Stream Char] -> Stream Char
482concat :: [Stream Char] -> Stream Char
483concat = L.foldr append empty
483concat = L.foldr append empty
484+{-# INLINE [0] concat #-}
484
485
485-- | Map a function over a stream that results in a stream and concatenate the
486-- | Map a function over a stream that results in a stream and concatenate the
486-- results.
487-- results.
487concatMap :: (Char -> Stream Char) -> Stream Char -> Stream Char
488concatMap :: (Char -> Stream Char) -> Stream Char -> Stream Char
488concatMap f = foldr (append . f) empty
489concatMap f = foldr (append . f) empty
490+{-# INLINE [0] concatMap #-}
489
491
490-- | /O(n)/ any @p @xs determines if any character in the stream
492-- | /O(n)/ any @p @xs determines if any character in the stream
491-- @xs@ satisifes the predicate @p@.
493-- @xs@ satisifes the predicate @p@.