on master help sign in
Unexport lines' for now

--HG-- extra : convert_revision : 5b3067058915a0d9944cf4b066a8910ce459166e

commit6818295d1a72ae09756fa4b07bc2da289e730e6f authorBryan O'Sullivan <bos@serpentine.com> dateMon 23 Feb 2009, 01:54 (18 years ago) parent39cfef6
2 files changed+7−4
Data/Text.hs+4−2 tests/Properties.hs+3−2
Data/Text.hs+4−2
@@ -110,7 +110,7 @@ module Data.Text
110110
111111 -- ** Breaking into lines and words
112112 , lines
113− , lines'
113+ --, lines'
114114 , words
115115 , unlines
116116 , unwords
@@ -918,6 +918,7 @@ lines ps | null ps = []
918918-- return immediately followed by a line feed, or a carriage return.
919919-- This accounts for both Unix and Windows line ending conventions,
920920-- and for the old convention used on Mac OS 9 and earlier.
921+{-
921922lines' :: Text -> [Text]
922923lines' ps | null ps = []
923924 | otherwise = h : case uncons t of
@@ -927,9 +928,10 @@ lines' ps | null ps = []
927928 | c == '\r' -> case uncons t' of
928929 Just ('\n',t'') -> lines t''
929930 _ -> lines t'
930− where (h,t) = span notEOL ps
931+ where (h,t) = span notEOL ps
931932 notEOL c = c /= '\n' && c /= '\r'
932933{-# INLINE lines' #-}
934+-}
933935
934936-- | /O(n)/ Joins lines, after appending a terminating newline to
935937-- each.
tests/Properties.hs+3−2
@@ -135,7 +135,6 @@ prop_tails = L.tails `eqP` (map unpack . T.tails)
135135
136136prop_split_i c = id `eq` (T.intercalate (T.singleton c) . T.split c)
137137
138−{-
139138prop_splitWith p = splitWith p `eqP` (map unpack . T.splitWith p)
140139
141140splitWith _ "" = []
@@ -152,6 +151,7 @@ prop_breakSubstringC c
152151 (unpack2 . T.breakSubstring (T.singleton c))
153152
154153prop_lines = L.lines `eqP` (map unpack . T.lines)
154+{-
155155prop_lines' = lines' `eqP` (map unpack . T.lines')
156156 where lines' "" = []
157157 lines' s = let (l, s') = break eol s
@@ -160,6 +160,7 @@ prop_lines' = lines' `eqP` (map unpack . T.lines')
160160 ('\r':'\n':s'') -> lines' s''
161161 (_:s'') -> lines' s''
162162 eol c = c == '\r' || c == '\n'
163+-}
163164prop_words = L.words `eqP` (map unpack . T.words)
164165prop_unlines = L.unlines `eq` (unpack . T.unlines . map pack)
165166prop_unwords = L.unwords `eq` (unpack . T.unwords . map pack)
@@ -279,7 +280,7 @@ tests = [
279280 ("prop_breakSubstring_isInfixOf", mytest prop_breakSubstring_isInfixOf),
280281
281282 ("prop_lines", mytest prop_lines),
282− ("prop_lines'", mytest prop_lines'),
283+--("prop_lines'", mytest prop_lines'),
283284 ("prop_words", mytest prop_words),
284285 ("prop_unlines", mytest prop_unlines),
285286 ("prop_unwords", mytest prop_unwords),