@@ -118,8 +118,8 @@ module Data.Text.Lazy
118 , stripStart
118 , stripStart
119 , stripEnd
119 , stripEnd
120 , splitAt
120 , splitAt
122− , break
122+ , breakBy
124 , groupBy
124 , groupBy
@@ -149,7 +149,7 @@ module Data.Text.Lazy
152− , partition
152+ , partitionBy
154 -- , findSubstring
154 -- , findSubstring
@@ -804,10 +804,10 @@ splitAt = loop
804 in (Chunk t ts', ts'')
804 in (Chunk t ts', ts'')
805 where len = fromIntegral (T.length t)
805 where len = fromIntegral (T.length t)
807−-- | /O(n)/ 'break' is like 'span', but the prefix returned is over
807+-- | /O(n)/ 'breakBy' is like 'spanBy', but the prefix returned is over
808-- elements that fail the predicate @p@.
808-- elements that fail the predicate @p@.
809−break :: (Char -> Bool) -> Text -> (Text, Text)
809+breakBy :: (Char -> Bool) -> Text -> (Text, Text)
810−break p t0 = break' t0
810+breakBy p t0 = break' t0
811 where break' Empty = (empty, empty)
811 where break' Empty = (empty, empty)
812 break' c@(Chunk t ts) =
812 break' c@(Chunk t ts) =
813 case T.findIndex p t of
813 case T.findIndex p t of
@@ -817,13 +817,13 @@ break p t0 = break' t0
817 | otherwise -> let (a,b) = T.splitAt n t
817 | otherwise -> let (a,b) = T.splitAt n t
818 in (Chunk a Empty, Chunk b ts)
818 in (Chunk a Empty, Chunk b ts)
820−-- | /O(n)/ 'span', applied to a predicate @p@ and text @t@, returns a
820+-- | /O(n)/ 'spanBy', applied to a predicate @p@ and text @t@, returns
821−-- pair whose first element is the longest prefix (possibly empty) of
821+-- a pair whose first element is the longest prefix (possibly empty)
822−-- @t@ of elements that satisfy @p@, and whose second is the remainder
822+-- of @t@ of elements that satisfy @p@, and whose second is the
823−-- of the list.
823+-- remainder of the list.
824−span :: (Char -> Bool) -> Text -> (Text, Text)
824+spanBy :: (Char -> Bool) -> Text -> (Text, Text)
825−span p = break (not . p)
825+spanBy p = breakBy (not . p)
826−{-# INLINE span #-}
826+{-# INLINE spanBy #-}
828-- | The 'group' function takes a 'Text' and returns a list of 'Text's
828-- | The 'group' function takes a 'Text' and returns a list of 'Text's
829-- such that the concatenation of the result is equal to the argument.
829-- such that the concatenation of the result is equal to the argument.
@@ -842,7 +842,7 @@ group = groupBy (==)
842groupBy :: (Char -> Char -> Bool) -> Text -> [Text]
842groupBy :: (Char -> Char -> Bool) -> Text -> [Text]
843groupBy _ Empty = []
843groupBy _ Empty = []
844groupBy eq (Chunk t ts) = cons x ys : groupBy eq zs
844groupBy eq (Chunk t ts) = cons x ys : groupBy eq zs
845− where (ys,zs) = span (eq x) xs
845+ where (ys,zs) = spanBy (eq x) xs
846 x = T.unsafeHead t
846 x = T.unsafeHead t
847 xs = chunk (T.unsafeTail t) ts
847 xs = chunk (T.unsafeTail t) ts
@@ -989,7 +989,7 @@ chunksOf k = go
989-- newline 'Char's. The resulting strings do not contain newlines.
989-- newline 'Char's. The resulting strings do not contain newlines.
990lines :: Text -> [Text]
990lines :: Text -> [Text]
991lines Empty = []
991lines Empty = []
992−lines t = let (l,t') = break ((==) '\n') t
992+lines t = let (l,t') = breakBy ((==) '\n') t
993 in l : if null t' then []
993 in l : if null t' then []
994 else lines (tail t')
994 else lines (tail t')
@@ -1067,14 +1067,14 @@ findBy :: (Char -> Bool) -> Text -> Maybe Char
1067findBy p t = S.findBy p (stream t)
1067findBy p t = S.findBy p (stream t)
1068{-# INLINE findBy #-}
1068{-# INLINE findBy #-}
1070−-- | /O(n)/ The 'partition' function takes a predicate and a 'Text',
1070+-- | /O(n)/ The 'partitionBy' function takes a predicate and a 'Text',
1071-- and returns the pair of 'Text's with elements which do and do not
1071-- and returns the pair of 'Text's with elements which do and do not
1072-- satisfy the predicate, respectively; i.e.
1072-- satisfy the predicate, respectively; i.e.
1074−-- > partition p t == (filter p t, filter (not . p) t)
1074+-- > partitionBy p t == (filter p t, filter (not . p) t)
1075−partition :: (Char -> Bool) -> Text -> (Text, Text)
1075+partitionBy :: (Char -> Bool) -> Text -> (Text, Text)
1076−partition p t = (filter p t, filter (not . p) t)
1076+partitionBy p t = (filter p t, filter (not . p) t)
1077−{-# INLINE partition #-}
1077+{-# INLINE partitionBy #-}
1079-- | /O(n)/ 'Text' index (subscript) operator, starting from 0.
1079-- | /O(n)/ 'Text' index (subscript) operator, starting from 0.
1080index :: Text -> Int64 -> Char
1080index :: Text -> Int64 -> Char