Permalink
Browse files

Merge

  • Loading branch information...
2 parents 3009568 + 3f108e1 commit 3d3432431f80deff72774ec613127a8df11f8c90 @bos committed Jan 7, 2012
Showing with 4 additions and 4 deletions.
  1. +3 −3 Data/Text.hs
  2. +1 −1 Data/Text/Lazy.hs
View
@@ -1275,9 +1275,9 @@ breakOnEnd pat src = (reverse b, reverse a)
--
-- Examples:
--
--- > find "::" ""
+-- > breakOnAll "::" ""
-- > ==> []
--- > find "/" "a/b/c/"
+-- > breakOnAll "/" "a/b/c/"
-- > ==> [("a", "/b/c/"), ("a/b", "/c/"), ("a/b/c", "/")]
--
-- In (unlikely) bad cases, this function's time complexity degrades
@@ -1312,7 +1312,7 @@ breakOnAll pat src@(Text arr off slen)
-- For example, suppose you have a string that you want to split on
-- the substring @\"::\"@, such as @\"foo::bar::quux\"@. Instead of
-- searching for the index of @\"::\"@ and taking the substrings
--- before and after that index, you would instead use @find \"::\"@.
+-- before and after that index, you would instead use @breakOnAll \"::\"@.
-- | /O(n)/ 'Text' index (subscript) operator, starting from 0.
index :: Text -> Int -> Char
View
@@ -1056,7 +1056,7 @@ splitAtWord x (Chunk c@(T.Text arr off len) cs)
-- > where (prefix, match) = breakOn needle haystack
--
-- If you need to break a string by a substring repeatedly (e.g. you
--- want to break on every instance of a substring), use 'find'
+-- want to break on every instance of a substring), use 'breakOnAll'
-- instead, as it has lower startup overhead.
--
-- This function is strict in its first argument, and lazy in its

0 comments on commit 3d34324

Please sign in to comment.