on master help sign in
Unexport lines' for now
6818295Bryan O'Sullivan
Data/Text.hs+4−2
@@ -110,7 +110,7 @@ module Data.Text
110
110
111 -- ** Breaking into lines and words
111 -- ** Breaking into lines and words
112 , lines
112 , lines
113− , lines'
113+ --, lines'
114 , words
114 , words
115 , unlines
115 , unlines
116 , unwords
116 , unwords
@@ -918,6 +918,7 @@ lines ps | null ps = []
918-- return immediately followed by a line feed, or a carriage return.
918-- return immediately followed by a line feed, or a carriage return.
919-- This accounts for both Unix and Windows line ending conventions,
919-- This accounts for both Unix and Windows line ending conventions,
920-- and for the old convention used on Mac OS 9 and earlier.
920-- and for the old convention used on Mac OS 9 and earlier.
921+{-
921lines' :: Text -> [Text]
922lines' :: Text -> [Text]
922lines' ps | null ps = []
923lines' ps | null ps = []
923 | otherwise = h : case uncons t of
924 | otherwise = h : case uncons t of
@@ -927,9 +928,10 @@ lines' ps | null ps = []
927 | c == '\r' -> case uncons t' of
928 | c == '\r' -> case uncons t' of
928 Just ('\n',t'') -> lines t''
929 Just ('\n',t'') -> lines t''
929 _ -> lines t'
930 _ -> lines t'
930− where (h,t) = span notEOL ps
931+ where (h,t) = span notEOL ps
931 notEOL c = c /= '\n' && c /= '\r'
932 notEOL c = c /= '\n' && c /= '\r'
932{-# INLINE lines' #-}
933{-# INLINE lines' #-}
934+-}
933
935
934-- | /O(n)/ Joins lines, after appending a terminating newline to
936-- | /O(n)/ Joins lines, after appending a terminating newline to
935-- each.
937-- each.
tests/Properties.hs+3−2
@@ -135,7 +135,6 @@ prop_tails = L.tails `eqP` (map unpack . T.tails)
135
135
136prop_split_i c = id `eq` (T.intercalate (T.singleton c) . T.split c)
136prop_split_i c = id `eq` (T.intercalate (T.singleton c) . T.split c)
137
137
138−{-
139prop_splitWith p = splitWith p `eqP` (map unpack . T.splitWith p)
138prop_splitWith p = splitWith p `eqP` (map unpack . T.splitWith p)
140
139
141splitWith _ "" = []
140splitWith _ "" = []
@@ -152,6 +151,7 @@ prop_breakSubstringC c
152 (unpack2 . T.breakSubstring (T.singleton c))
151 (unpack2 . T.breakSubstring (T.singleton c))
153
152
154prop_lines = L.lines `eqP` (map unpack . T.lines)
153prop_lines = L.lines `eqP` (map unpack . T.lines)
154+{-
155prop_lines' = lines' `eqP` (map unpack . T.lines')
155prop_lines' = lines' `eqP` (map unpack . T.lines')
156 where lines' "" = []
156 where lines' "" = []
157 lines' s = let (l, s') = break eol s
157 lines' s = let (l, s') = break eol s
@@ -160,6 +160,7 @@ prop_lines' = lines' `eqP` (map unpack . T.lines')
160 ('\r':'\n':s'') -> lines' s''
160 ('\r':'\n':s'') -> lines' s''
161 (_:s'') -> lines' s''
161 (_:s'') -> lines' s''
162 eol c = c == '\r' || c == '\n'
162 eol c = c == '\r' || c == '\n'
163+-}
163prop_words = L.words `eqP` (map unpack . T.words)
164prop_words = L.words `eqP` (map unpack . T.words)
164prop_unlines = L.unlines `eq` (unpack . T.unlines . map pack)
165prop_unlines = L.unlines `eq` (unpack . T.unlines . map pack)
165prop_unwords = L.unwords `eq` (unpack . T.unwords . map pack)
166prop_unwords = L.unwords `eq` (unpack . T.unwords . map pack)
@@ -279,7 +280,7 @@ tests = [
279 ("prop_breakSubstring_isInfixOf", mytest prop_breakSubstring_isInfixOf),
280 ("prop_breakSubstring_isInfixOf", mytest prop_breakSubstring_isInfixOf),
280
281
281 ("prop_lines", mytest prop_lines),
282 ("prop_lines", mytest prop_lines),
282− ("prop_lines'", mytest prop_lines'),
283+--("prop_lines'", mytest prop_lines'),
283 ("prop_words", mytest prop_words),
284 ("prop_words", mytest prop_words),
284 ("prop_unlines", mytest prop_unlines),
285 ("prop_unlines", mytest prop_unlines),
285 ("prop_unwords", mytest prop_unwords),
286 ("prop_unwords", mytest prop_unwords),