Commits

Bryan O'Sullivan  committed ed62fc5

Tweak docs a little.

  • Participants
  • Parent commits 21cf079

Comments (0)

Files changed (2)

File Data/Text.hs

 -- > intercalate s . split s         == id
 -- > split (singleton c)             == splitBy (==c)
 --
--- In (unlikely) bad cases, this function's time complexity
--- degenerates towards /O(n*m)/.
+-- In (unlikely) bad cases, this function's time complexity degrades
+-- towards /O(n*m)/.
 split :: Text -> Text -> [Text]
 split pat@(Text _ _ l) src@(Text arr off len)
     | l <= 0          = emptyError "split"
 -- want to break on every instance of a substring), use 'find'
 -- instead, as it has lower startup overhead.
 --
--- In (unlikely) bad cases, this function's time complexity
--- degenerates towards /O(n*m)/.
+-- In (unlikely) bad cases, this function's time complexity degrades
+-- towards /O(n*m)/.
 break :: Text -> Text -> (Text, Text)
 break pat src@(Text arr off len)
     | null pat  = emptyError "break"
 -- query string appears in the given 'Text'. An empty query string is
 -- invalid, and will cause an error to be raised.
 --
--- In (unlikely) bad cases, this function's time complexity
--- degenerates towards /O(n*m)/.
+-- In (unlikely) bad cases, this function's time complexity degrades
+-- towards /O(n*m)/.
 count :: Text -> Text -> Int
 count pat src
     | null pat        = emptyError "count"
 -- 'True' iff the first is contained, wholly and intact, anywhere
 -- within the second.
 --
--- In (unlikely) bad cases, this function's time complexity
--- degenerates towards /O(n*m)/.
+-- In (unlikely) bad cases, this function's time complexity degrades
+-- towards /O(n*m)/.
 isInfixOf :: Text -> Text -> Bool
 isInfixOf pat src = null pat || (not . L.null $ indices pat src)
 {-# INLINE isInfixOf #-}

File Data/Text/Search.hs

 import Data.Text.UnsafeShift (shiftL)
 
 -- | /O(n+m)/ Find the offsets of all non-overlapping indices of
--- @needle@ within @haystack@. In (unlikely) bad cases, this
--- algorithm's complexity degenerates towards /O(n*m)/.
+-- @needle@ within @haystack@.
+--
+-- In (unlikely) bad cases, this algorithm's complexity degrades
+-- towards /O(n*m)/.
 indices :: Text                -- ^ Substring to search for (@needle@)
         -> Text                -- ^ Text to search in (@haystack@)
         -> [Int]