on master help sign in
Tidy up haddocks nicely

--HG-- extra : convert_revision : dfbe983b50c23a4f33535c14802cf4073d056a95

commitd36ec833070f258deedb8d0a3dcb75b48cb4b210 authorBryan O'Sullivan <bos@serpentine.com> dateMon 23 Feb 2009, 01:55 (18 years ago) parent0099c10
1 file changed+21−19
Data/Text.hs+21−19
Data/Text.hs+21−19
@@ -139,7 +139,7 @@ module Data.Text
139139 -- * Zipping and unzipping
140140 , zipWith
141141
142− -- * Ordered text
142+ -- -* Ordered text
143143 , -- sort
144144 ) where
145145
@@ -399,7 +399,7 @@ reverse t = S.reverse (stream t)
399399
400400-- | /O(n)/ The 'transpose' function transposes the rows and columns
401401-- of its 'Text' argument. Note that this function uses 'pack',
402−-- 'unpack', and the 'List' version of transpose and is thus not very
402+-- 'unpack', and the list version of transpose, and is thus not very
403403-- efficient.
404404transpose :: [Text] -> [Text]
405405transpose ts = P.map pack (L.transpose (P.map unpack ts))
@@ -407,7 +407,7 @@ transpose ts = P.map pack (L.transpose (P.map unpack ts))
407407-- -----------------------------------------------------------------------------
408408-- * Reducing 'Text's (folds)
409409
410−-- | 'foldl', applied to a binary operator, a starting value
410+-- | /O(n)/ 'foldl', applied to a binary operator, a starting value
411411-- (typically the left-identity of the operator), and a 'Text',
412412-- reduces the 'Text' using the binary operator, from left to right.
413413-- Subject to array fusion.
@@ -415,26 +415,26 @@ foldl :: (b -> Char -> b) -> b -> Text -> b
415415foldl f z t = S.foldl f z (stream t)
416416{-# INLINE foldl #-}
417417
418−-- | A strict version of 'foldl'.
418+-- | /O(n)/ A strict version of 'foldl'.
419419-- Subject to array fusion.
420420foldl' :: (b -> Char -> b) -> b -> Text -> b
421421foldl' f z t = S.foldl' f z (stream t)
422422{-# INLINE foldl' #-}
423423
424−-- | A variant of 'foldl' that has no starting value argument, and
425−-- thus must be applied to a non-empty 'Text'. Subject to array
424+-- | /O(n)/ A variant of 'foldl' that has no starting value argument,
425+-- and thus must be applied to a non-empty 'Text'. Subject to array
426426-- fusion.
427427foldl1 :: (Char -> Char -> Char) -> Text -> Char
428428foldl1 f t = S.foldl1 f (stream t)
429429{-# INLINE foldl1 #-}
430430
431−-- | A strict version of 'foldl1'.
431+-- | /O(n)/ A strict version of 'foldl1'.
432432-- Subject to array fusion.
433433foldl1' :: (Char -> Char -> Char) -> Text -> Char
434434foldl1' f t = S.foldl1' f (stream t)
435435{-# INLINE foldl1' #-}
436436
437−-- | 'foldr', applied to a binary operator, a starting value
437+-- | /O(n)/ 'foldr', applied to a binary operator, a starting value
438438-- (typically the right-identity of the operator), and a 'Text',
439439-- reduces the 'Text' using the binary operator, from right to left.
440440-- Subject to array fusion.
@@ -442,7 +442,7 @@ foldr :: (Char -> b -> b) -> b -> Text -> b
442442foldr f z t = S.foldr f z (stream t)
443443{-# INLINE foldr #-}
444444
445−-- | A variant of 'foldr' that has no starting value argument, and
445+-- | /O(n)/ A variant of 'foldr' that has no starting value argument, and
446446-- thust must be applied to a non-empty 'Text'. Subject to array
447447-- fusion.
448448foldr1 :: (Char -> Char -> Char) -> Text -> Char
@@ -457,23 +457,23 @@ concat :: [Text] -> Text
457457concat ts = unstream (S.concat (L.map stream ts))
458458{-# INLINE concat #-}
459459
460−-- | Map a function over a 'Text' that results in a 'Text', and concatenate the
461−-- results. This function is subject to array fusion.
460+-- | /O(n)/ Map a function over a 'Text' that results in a 'Text', and
461+-- concatenate the results. This function is subject to array fusion.
462462--
463−-- Note: if in 'concatMap' @f @xs, @f@ is defined in terms of fusible
463+-- Note: if in 'concatMap' @f@ @t@, @f@ is defined in terms of fusible
464464-- functions, it will also be fusible.
465465concatMap :: (Char -> Text) -> Text -> Text
466466concatMap f t = unstream (S.concatMap (stream . f) (stream t))
467467{-# INLINE concatMap #-}
468468
469−-- | 'any' @p @xs determines whether any character in the 'Text' @xs@
470−-- satisifes the predicate @p@. Subject to array fusion.
469+-- | /O(n)/ 'any' @p@ @t@ determines whether any character in the
470+-- 'Text' @t@ satisifes the predicate @p@. Subject to array fusion.
471471any :: (Char -> Bool) -> Text -> Bool
472472any p t = S.any p (stream t)
473473{-# INLINE any #-}
474474
475−-- | 'all' @p @xs determines whether all characters in the 'Text' @xs@
476−-- satisify the predicate @p@. Subject to array fusion.
475+-- | /O(n)/ 'all' @p@ @t@ determines whether all characters in the
476+-- 'Text' @t@ satisify the predicate @p@. Subject to array fusion.
477477all :: (Char -> Bool) -> Text -> Bool
478478all p t = S.all p (stream t)
479479{-# INLINE all #-}
@@ -553,6 +553,8 @@ mapAccumR f s t = case uncons t of
553553-- -----------------------------------------------------------------------------
554554-- ** Generating and unfolding 'Text's
555555
556+-- | /O(n)/ 'replicate' @n@ @c@ is a 'Text' of length @n@ with @c@ the
557+-- value of every element.
556558replicate :: Int -> Char -> Text
557559replicate n c = unstream (S.replicate n c)
558560{-# INLINE replicate #-}
@@ -579,7 +581,7 @@ unfoldrN n f s = unstream (S.unfoldrN n f s)
579581-- -----------------------------------------------------------------------------
580582-- * Substrings
581583
582−-- /O(n) 'take' @n@, applied to a 'Text', returns the prefix of the
584+-- | /O(n)/ 'take' @n@, applied to a 'Text', returns the prefix of the
583585-- 'Text' of length @n@, or the 'Text' itself if @n@ is greater than
584586-- the length of the Text.
585587take :: Int -> Text -> Text
@@ -792,8 +794,8 @@ partition :: (Char -> Bool) -> Text -> (Text, Text)
792794partition p t = (filter p t, filter (not . p) t)
793795{-# INLINE partition #-}
794796
795−-- | Break a string on a substring, returning a pair of the part of the
796−-- string prior to the match, and the rest of the string.
797+-- | /O(n)/ Break a string on a substring, returning a pair of the
798+-- part of the string prior to the match, and the rest of the string.
797799--
798800-- The following relationship holds:
799801--