@@ -118,8 +118,8 @@ module Data.Text.Lazy
118118 , stripStart
119119 , stripEnd
120120 , splitAt
121− , span
122− , break
121+ , spanBy
122+ , breakBy
123123 , group
124124 , groupBy
125125 , inits
@@ -149,7 +149,7 @@ module Data.Text.Lazy
149149 , elem
150150 , filter
151151 , findBy
152− , partition
152+ , partitionBy
153153
154154 -- , findSubstring
155155
@@ -804,10 +804,10 @@ splitAt = loop
804804 in (Chunk t ts', ts'')
805805 where len = fromIntegral (T.length t)
806806
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
808808-- elements that fail the predicate @p@.
809−break :: (Char -> Bool) -> Text -> (Text, Text)
810−break p t0 = break' t0
809+breakBy :: (Char -> Bool) -> Text -> (Text, Text)
810+breakBy p t0 = break' t0
811811 where break' Empty = (empty, empty)
812812 break' c@(Chunk t ts) =
813813 case T.findIndex p t of
@@ -817,13 +817,13 @@ break p t0 = break' t0
817817 | otherwise -> let (a,b) = T.splitAt n t
818818 in (Chunk a Empty, Chunk b ts)
819819
820−-- | /O(n)/ 'span', applied to a predicate @p@ and text @t@, returns a
821−-- pair whose first element is the longest prefix (possibly empty) of
822−-- @t@ of elements that satisfy @p@, and whose second is the remainder
823−-- of the list.
824−span :: (Char -> Bool) -> Text -> (Text, Text)
825−span p = break (not . p)
826−{-# INLINE span #-}
820+-- | /O(n)/ 'spanBy', applied to a predicate @p@ and text @t@, returns
821+-- a pair whose first element is the longest prefix (possibly empty)
822+-- of @t@ of elements that satisfy @p@, and whose second is the
823+-- remainder of the list.
824+spanBy :: (Char -> Bool) -> Text -> (Text, Text)
825+spanBy p = breakBy (not . p)
826+{-# INLINE spanBy #-}
827827
828828-- | The 'group' function takes a 'Text' and returns a list of 'Text's
829829-- such that the concatenation of the result is equal to the argument.
@@ -842,7 +842,7 @@ group = groupBy (==)
842842groupBy :: (Char -> Char -> Bool) -> Text -> [Text]
843843groupBy _ Empty = []
844844groupBy 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
846846 x = T.unsafeHead t
847847 xs = chunk (T.unsafeTail t) ts
848848
@@ -989,7 +989,7 @@ chunksOf k = go
989989-- newline 'Char's. The resulting strings do not contain newlines.
990990lines :: Text -> [Text]
991991lines Empty = []
992−lines t = let (l,t') = break ((==) '\n') t
992+lines t = let (l,t') = breakBy ((==) '\n') t
993993 in l : if null t' then []
994994 else lines (tail t')
995995
@@ -1067,14 +1067,14 @@ findBy :: (Char -> Bool) -> Text -> Maybe Char
10671067findBy p t = S.findBy p (stream t)
10681068{-# INLINE findBy #-}
10691069
1070−-- | /O(n)/ The 'partition' function takes a predicate and a 'Text',
1070+-- | /O(n)/ The 'partitionBy' function takes a predicate and a 'Text',
10711071-- and returns the pair of 'Text's with elements which do and do not
10721072-- satisfy the predicate, respectively; i.e.
10731073--
1074−-- > partition p t == (filter p t, filter (not . p) t)
1075−partition :: (Char -> Bool) -> Text -> (Text, Text)
1076−partition p t = (filter p t, filter (not . p) t)
1077−{-# INLINE partition #-}
1074+-- > partitionBy p t == (filter p t, filter (not . p) t)
1075+partitionBy :: (Char -> Bool) -> Text -> (Text, Text)
1076+partitionBy p t = (filter p t, filter (not . p) t)
1077+{-# INLINE partitionBy #-}
10781078
10791079-- | /O(n)/ 'Text' index (subscript) operator, starting from 0.
10801080index :: Text -> Int64 -> Char