@@ -50,6 +50,7 @@ module Data.Text
5050
5151 -- * Transformations
5252 , map
53+ , intercalate
5354 , intersperse
5455 , transpose
5556
@@ -306,6 +307,13 @@ map :: (Char -> Char) -> Text -> Text
306307map f t = unstream (S.map f (stream t))
307308{-# INLINE [1] map #-}
308309
310+-- | /O(n)/ The 'intercalate' function takes a 'Text' and a list of
311+-- 'Text's and concatenates the list after interspersing the first
312+-- argument between each element of the list.
313+intercalate :: Text -> [Text] -> Text
314+intercalate t ts = unstream (S.intercalate (stream t) (L.map stream ts))
315+{-# INLINE intercalate #-}
316+
309317-- | /O(n)/ The 'intersperse' function takes a character and places it
310318-- between the characters of a 'Text'. Subject to array fusion.
311319intersperse :: Char -> Text -> Text