Commits

Bryan O'Sullivan  committed 367ca64

White space and strictness comment tweaks.

  • Participants
  • Parent commits d5eaf5b

Comments (0)

Files changed (1)

File Data/Text/Lazy.hs

 -- length of the 'Text'. Subject to fusion.
 drop :: Int64 -> Text -> Text
 drop i t0
-    | i <= 0 = t0
+    | i <= 0    = t0
     | otherwise = drop' i t0
   where drop' 0 ts           = ts
         drop' _ Empty        = Empty
         drop' n (Chunk t ts) 
-            | n < len = Chunk (T.drop (fromIntegral n) t) ts
+            | n < len   = Chunk (T.drop (fromIntegral n) t) ts
             | otherwise = drop' (n - len) ts
-            where len = fromIntegral (T.length t)
+            where len   = fromIntegral (T.length t)
 {-# INLINE [1] drop #-}
 
 {-# RULES
 -- want to break on every instance of a substring), use 'find'
 -- instead, as it has lower startup overhead.
 --
+-- This function is strict in its first argument, and lazy in its
+-- second.
+--
 -- In (unlikely) bad cases, this function's time complexity degrades
 -- towards /O(n*m)/.
 break :: Text -> Text -> (Text, Text)
 -- > intercalate s . split s         == id
 -- > split (singleton c)             == splitBy (==c)
 --
+-- This function is strict in its first argument, and lazy in its
+-- second.
+--
 -- In (unlikely) bad cases, this function's time complexity degrades
 -- towards /O(n*m)/.
 split :: Text                   -- ^ Text to split on
 -- 'True' iff the first is contained, wholly and intact, anywhere
 -- within the second.
 --
+-- This function is strict in its first argument, and lazy in its
+-- second.
+--
 -- In (unlikely) bad cases, this function's time complexity degrades
 -- towards /O(n*m)/.
 isInfixOf :: Text -> Text -> Bool