on master help sign in
More comment fixes.

--HG-- extra : convert_revision : 254ad5b48905ce121f45e30cabeabcfa3048c7e2

commit5128fb6bf07497a293b6f4d22e60baeeb50cd53e authorBryan O'Sullivan <bos@serpentine.com> dateSun 5 Jul 2009, 04:27 (17 years ago) parentfd4a35c
2 files changed+6−2
Data/Text.hs+5−1 Data/Text/Lazy.hs+1−1
Data/Text.hs+5−1
@@ -366,7 +366,7 @@ length t = S.length (stream t)
366366
367367-- -----------------------------------------------------------------------------
368368-- * Transformations
369−-- | /O(n)/ 'map' @f @t@ is the 'Text' obtained by applying @f@ to
369+-- | /O(n)/ 'map' @f@ @t@ is the 'Text' obtained by applying @f@ to
370370-- each element of @t@. Subject to array fusion.
371371map :: (Char -> Char) -> Text -> Text
372372map f t = unstream (S.map f (stream t))
@@ -712,6 +712,10 @@ dropWhile p t@(Text arr off len) = loop 0 0
712712-- | /O(n)/ 'dropAfter' @p@ @t@ returns the prefix remaining after
713713-- dropping characters that fail the predicate @p@ from the end of
714714-- @t@. This function is subject to array fusion.
715+--
716+-- For example, to drop trailing white space:
717+--
718+-- > dropAfter isSpace
715719dropAfter :: (Char -> Bool) -> Text -> Text
716720dropAfter p t@(Text arr off len) = loop (len-1) len
717721 where loop !i !l | l <= 0 = empty
Data/Text/Lazy.hs+1−1
@@ -339,7 +339,7 @@ length = foldlChunks go 0
339339 S.length (stream t) = length t
340340 #-}
341341
342−-- | /O(n)/ 'map' @f @t@ is the 'Text' obtained by applying @f@ to
342+-- | /O(n)/ 'map' @f@ @t@ is the 'Text' obtained by applying @f@ to
343343-- each element of @t@. Subject to array fusion.
344344map :: (Char -> Char) -> Text -> Text
345345map f t = unstream (S.map f (stream t))