on master help sign in
Documentation fix for breakOnAll.

Replaced occurences of 'find' in the 'breakOnAll' examples. Also replaced 'find' with 'breakOnAll' in the Indexing discussion. Replaced 'find' with 'breakOnAll' in 'breakOn' discussion in Data.Text.Lazy.

commit3f108e1b89e59e121acc8119a20497d3b8da4b83 authorJohn Chee <cheecheeo@gmail.com> dateMon 5 Dec 2011, 17:46 (15 years ago) parentb88098c
2 files changed+4−4
Data/Text.hs+3−3 Data/Text/Lazy.hs+1−1
Data/Text.hs+3−3
@@ -1277,9 +1277,9 @@ breakOnEnd pat src = (reverse b, reverse a)
12771277--
12781278-- Examples:
12791279--
1280−-- > find "::" ""
1280+-- > breakOnAll "::" ""
12811281-- > ==> []
1282−-- > find "/" "a/b/c/"
1282+-- > breakOnAll "/" "a/b/c/"
12831283-- > ==> [("a", "/b/c/"), ("a/b", "/c/"), ("a/b/c", "/")]
12841284--
12851285-- In (unlikely) bad cases, this function's time complexity degrades
@@ -1314,7 +1314,7 @@ breakOnAll pat src@(Text arr off slen)
13141314-- For example, suppose you have a string that you want to split on
13151315-- the substring @\"::\"@, such as @\"foo::bar::quux\"@. Instead of
13161316-- searching for the index of @\"::\"@ and taking the substrings
1317−-- before and after that index, you would instead use @find \"::\"@.
1317+-- before and after that index, you would instead use @breakOnAll \"::\"@.
13181318
13191319-- | /O(n)/ 'Text' index (subscript) operator, starting from 0.
13201320index :: 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