on master help sign in
Tweak docs a little.

--HG-- extra : convert_revision : 85e3387ca6dad428f1c242a7ccdd40bc8045a52c

commitb69c07431df683403fa6f9faa2f43ae272e508e3 authorBryan O'Sullivan <bos@serpentine.com> dateTue 6 Oct 2009, 22:06 (17 years ago) parente12e119
2 files changed+12−10
Data/Text.hs+8−8 Data/Text/Search.hs+4−2
Data/Text.hs+8−8
@@ -915,8 +915,8 @@ tails t | null t = [empty]
915915-- > intercalate s . split s == id
916916-- > split (singleton c) == splitBy (==c)
917917--
918−-- In (unlikely) bad cases, this function's time complexity
919−-- degenerates towards /O(n*m)/.
918+-- In (unlikely) bad cases, this function's time complexity degrades
919+-- towards /O(n*m)/.
920920split :: Text -> Text -> [Text]
921921split pat@(Text _ _ l) src@(Text arr off len)
922922 | l <= 0 = emptyError "split"
@@ -1017,8 +1017,8 @@ filter p t = unstream (S.filter p (stream t))
10171017-- want to break on every instance of a substring), use 'find'
10181018-- instead, as it has lower startup overhead.
10191019--
1020−-- In (unlikely) bad cases, this function's time complexity
1021−-- degenerates towards /O(n*m)/.
1020+-- In (unlikely) bad cases, this function's time complexity degrades
1021+-- towards /O(n*m)/.
10221022break :: Text -> Text -> (Text, Text)
10231023break pat src@(Text arr off len)
10241024 | null pat = emptyError "break"
@@ -1091,8 +1091,8 @@ findIndex p t = S.findIndex p (stream t)
10911091-- query string appears in the given 'Text'. An empty query string is
10921092-- invalid, and will cause an error to be raised.
10931093--
1094−-- In (unlikely) bad cases, this function's time complexity
1095−-- degenerates towards /O(n*m)/.
1094+-- In (unlikely) bad cases, this function's time complexity degrades
1095+-- towards /O(n*m)/.
10961096count :: Text -> Text -> Int
10971097count pat src
10981098 | null pat = emptyError "count"
@@ -1217,8 +1217,8 @@ isSuffixOf a@(Text _aarr _aoff alen) b@(Text barr boff blen) =
12171217-- 'True' iff the first is contained, wholly and intact, anywhere
12181218-- within the second.
12191219--
1220−-- In (unlikely) bad cases, this function's time complexity
1221−-- degenerates towards /O(n*m)/.
1220+-- In (unlikely) bad cases, this function's time complexity degrades
1221+-- towards /O(n*m)/.
12221222isInfixOf :: Text -> Text -> Bool
12231223isInfixOf pat src = null pat || (not . L.null $ indices pat src)
12241224{-# INLINE isInfixOf #-}
Data/Text/Search.hs+4−2
@@ -39,8 +39,10 @@ import Data.Bits ((.|.), (.&.))
3939import Data.Text.UnsafeShift (shiftL)
4040
4141-- | /O(n+m)/ Find the offsets of all non-overlapping indices of
42−-- @needle@ within @haystack@. In (unlikely) bad cases, this
43−-- algorithm's complexity degenerates towards /O(n*m)/.
42+-- @needle@ within @haystack@.
43+--
44+-- In (unlikely) bad cases, this algorithm's complexity degrades
45+-- towards /O(n*m)/.
4446indices :: Text -- ^ Substring to search for (@needle@)
4547 -> Text -- ^ Text to search in (@haystack@)
4648 -> [Int]