Commits

Bryan O'Sullivan  committed 538a222

More comment fixes.

  • Participants
  • Parent commits a3e808a

Comments (0)

Files changed (2)

File Data/Text.hs

 
 -- -----------------------------------------------------------------------------
 -- * Transformations
--- | /O(n)/ 'map' @f @t@ is the 'Text' obtained by applying @f@ to
+-- | /O(n)/ 'map' @f@ @t@ is the 'Text' obtained by applying @f@ to
 -- each element of @t@.  Subject to array fusion.
 map :: (Char -> Char) -> Text -> Text
 map f t = unstream (S.map f (stream t))
 -- | /O(n)/ 'dropAfter' @p@ @t@ returns the prefix remaining after
 -- dropping characters that fail the predicate @p@ from the end of
 -- @t@.  This function is subject to array fusion.
+--
+-- For example, to drop trailing white space:
+--
+-- > dropAfter isSpace
 dropAfter :: (Char -> Bool) -> Text -> Text
 dropAfter p t@(Text arr off len) = loop (len-1) len
   where loop !i !l | l <= 0    = empty

File Data/Text/Lazy.hs

     S.length (stream t) = length t
  #-}
 
--- | /O(n)/ 'map' @f @t@ is the 'Text' obtained by applying @f@ to
+-- | /O(n)/ 'map' @f@ @t@ is the 'Text' obtained by applying @f@ to
 -- each element of @t@.  Subject to array fusion.
 map :: (Char -> Char) -> Text -> Text
 map f t = unstream (S.map f (stream t))