on master help sign in
Comment and whitespace tidyups

--HG-- extra : convert_revision : 33383d8f8e8bf7bedfda33ce7badbfba350490b7

commit889b318662b3f03e409f5013cad19ecd75019396 authorBryan O'Sullivan <bos@serpentine.com> dateWed 28 Jan 2009, 06:23 (18 years ago) parentaa4cdeb
1 file changed+8−6
Data/Text.hs+8−6
Data/Text.hs+8−6
@@ -302,9 +302,9 @@ second f (a, b) = (a, f b)
302302-- non-empty. Subject to array fusion.
303303last :: Text -> Char
304304last (Text arr off len)
305− | len <= 0 = errorEmptyList "last"
305+ | len <= 0 = errorEmptyList "last"
306306 | n < 0xDC00 || n > 0xDFFF = unsafeChr n
307− | otherwise = U16.chr2 n0 n
307+ | otherwise = U16.chr2 n0 n
308308 where
309309 n = A.unsafeIndex arr (off+len-1)
310310 n0 = A.unsafeIndex arr (off+len-2)
@@ -566,15 +566,17 @@ drop n t@(Text arr off len)
566566 unstream (S.drop n (stream t)) = drop n t
567567 #-}
568568
569−-- | 'takeWhile', applied to a predicate @p@ and a 'Text', returns the
569+-- | /O(n)/ 'takeWhile', applied to a predicate @p@ and a 'Text', returns the
570570-- longest prefix (possibly empty) of elements that satisfy @p@.
571571takeWhile :: (Char -> Bool) -> Text -> Text
572572takeWhile p t = unstream (S.takeWhile p (stream t))
573+{-# INLINE takeWhile #-}
573574
574−-- | 'dropWhile' @p@ @xs@ returns the suffix remaining after
575+-- | /O(n)/ 'dropWhile' @p@ @xs@ returns the suffix remaining after
575576-- 'takeWhile' @p@ @xs@.
576577dropWhile :: (Char -> Bool) -> Text -> Text
577578dropWhile p t = unstream (S.dropWhile p (stream t))
579+{-# INLINE dropWhile #-}
578580
579581-- | /O(n)/ Return all initial segments of the given 'Text', shortest
580582-- first.
@@ -584,8 +586,8 @@ inits (Text arr off len) = [Text arr off l | l <- [0..len]]
584586-- | /O(n)/ Return all final segments of the given 'Text', longest
585587-- first.
586588tails :: Text -> [Text]
587−tails p | null p = [empty]
588− | otherwise = p : tails (tail p)
589+tails t | null t = [empty]
590+ | otherwise = t : tails (tail t)
589591
590592-- ----------------------------------------------------------------------------
591593-- * Searching