@@ -109,8 +109,10 @@ module Data.Text
109109 -- , breakSubstring
110110
111111 -- ** Breaking into lines and words
112− , words
113112 , lines
113+ , words
114+ , unlines
115+ , unwords
114116
115117 -- * Predicates
116118 -- , isPrefixOf
@@ -655,5 +657,16 @@ lines ps
655657 where search = elemIndex '\n'
656658{-# INLINE lines #-}
657659
660+-- | /O(n)/ Joins lines, after appending a terminating newline to
661+-- each.
662+unlines :: [Text] -> Text
663+unlines = concat . L.map (`snoc` '\n')
664+{-# INLINE unlines #-}
665+
666+-- | /O(n)/ Joins words using single space characters.
667+unwords :: [Text] -> Text
668+unwords = intercalate (singleton ' ')
669+{-# INLINE unwords #-}
670+
658671errorEmptyList :: String -> a
659672errorEmptyList fun = error ("Data.Text." ++ fun ++ ": empty list")