on master help sign in
Merge
commit3d3432431f80deff72774ec613127a8df11f8c90 authorBryan O'Sullivan <bos@serpentine.com> dateSat 7 Jan 2012, 14:01 (15 years ago) parent30095683f108e1
2 files changed+4−4
Data/Text.hs+3−3 Data/Text/Lazy.hs+1−1
Data/Text.hs+3−3
@@ -1275,9 +1275,9 @@ breakOnEnd pat src = (reverse b, reverse a)
12751275--
12761276-- Examples:
12771277--
1278−-- > find "::" ""
1278+-- > breakOnAll "::" ""
12791279-- > ==> []
1280−-- > find "/" "a/b/c/"
1280+-- > breakOnAll "/" "a/b/c/"
12811281-- > ==> [("a", "/b/c/"), ("a/b", "/c/"), ("a/b/c", "/")]
12821282--
12831283-- In (unlikely) bad cases, this function's time complexity degrades
@@ -1312,7 +1312,7 @@ breakOnAll pat src@(Text arr off slen)
13121312-- For example, suppose you have a string that you want to split on
13131313-- the substring @\"::\"@, such as @\"foo::bar::quux\"@. Instead of
13141314-- searching for the index of @\"::\"@ and taking the substrings
1315−-- before and after that index, you would instead use @find \"::\"@.
1315+-- before and after that index, you would instead use @breakOnAll \"::\"@.
13161316
13171317-- | /O(n)/ 'Text' index (subscript) operator, starting from 0.
13181318index :: Text -> Int -> Char
Data/Text/Lazy.hs+1−1
@@ -1056,7 +1056,7 @@ splitAtWord x (Chunk c@(T.Text arr off len) cs)
10561056-- > where (prefix, match) = breakOn needle haystack
10571057--
10581058-- If you need to break a string by a substring repeatedly (e.g. you
1059−-- want to break on every instance of a substring), use 'find'
1059+-- want to break on every instance of a substring), use 'breakOnAll'
10601060-- instead, as it has lower startup overhead.
10611061--
10621062-- This function is strict in its first argument, and lazy in its