on master help sign in
White space and strictness comment tweaks.

--HG-- extra : convert_revision : 7639d5b4618acf987ea31b9dad559361cc55a11b

commitc16786ceae5b3a660791dcc29da0523c6edd5ec2 authorBryan O'Sullivan <bos@serpentine.com> dateFri 9 Oct 2009, 05:24 (17 years ago) parentaf2fdf7
1 file changed+12−3
Data/Text/Lazy.hs+12−3
Data/Text/Lazy.hs+12−3
@@ -699,14 +699,14 @@ take i t0 = take' i t0
699699-- length of the 'Text'. Subject to fusion.
700700drop :: Int64 -> Text -> Text
701701drop i t0
702− | i <= 0 = t0
702+ | i <= 0 = t0
703703 | otherwise = drop' i t0
704704 where drop' 0 ts = ts
705705 drop' _ Empty = Empty
706706 drop' n (Chunk t ts)
707− | n < len = Chunk (T.drop (fromIntegral n) t) ts
707+ | n < len = Chunk (T.drop (fromIntegral n) t) ts
708708 | otherwise = drop' (n - len) ts
709− where len = fromIntegral (T.length t)
709+ where len = fromIntegral (T.length t)
710710{-# INLINE [1] drop #-}
711711
712712{-# RULES
@@ -860,6 +860,9 @@ splitAtWord x (Chunk c@(T.Text arr off len) cs)
860860-- want to break on every instance of a substring), use 'find'
861861-- instead, as it has lower startup overhead.
862862--
863+-- This function is strict in its first argument, and lazy in its
864+-- second.
865+--
863866-- In (unlikely) bad cases, this function's time complexity degrades
864867-- towards /O(n*m)/.
865868break :: Text -> Text -> (Text, Text)
@@ -949,6 +952,9 @@ tails ts@(Chunk t ts')
949952-- > intercalate s . split s == id
950953-- > split (singleton c) == splitBy (==c)
951954--
955+-- This function is strict in its first argument, and lazy in its
956+-- second.
957+--
952958-- In (unlikely) bad cases, this function's time complexity degrades
953959-- towards /O(n*m)/.
954960split :: Text -- ^ Text to split on
@@ -1059,6 +1065,9 @@ isSuffixOf x y = reverse x `isPrefixOf` reverse y
10591065-- 'True' iff the first is contained, wholly and intact, anywhere
10601066-- within the second.
10611067--
1068+-- This function is strict in its first argument, and lazy in its
1069+-- second.
1070+--
10621071-- In (unlikely) bad cases, this function's time complexity degrades
10631072-- towards /O(n*m)/.
10641073isInfixOf :: Text -> Text -> Bool