on master help sign in
Small haddock edits
7f1b04bBryan O'Sullivan
Data/Text.hs+3
@@ -535,6 +535,9 @@ reverse t = S.reverse (stream t)
535{-# INLINE reverse #-}
535{-# INLINE reverse #-}
536
536
537-- | /O(m+n)/ Replace every occurrence of one substring with another.
537-- | /O(m+n)/ Replace every occurrence of one substring with another.
538+--
539+-- In (unlikely) bad cases, this function's time complexity degrades
540+-- towards /O(n*m)/.
538replace :: Text -- ^ Text to search for
541replace :: Text -- ^ Text to search for
539 -> Text -- ^ Replacement text
542 -> Text -- ^ Replacement text
540 -> Text -- ^ Input text
543 -> Text -- ^ Input text
Data/Text/Lazy.hs+4−1
@@ -27,7 +27,7 @@
27-- This module is intended to be imported @qualified@, to avoid name
27-- This module is intended to be imported @qualified@, to avoid name
28-- clashes with "Prelude" functions. eg.
28-- clashes with "Prelude" functions. eg.
29--
29--
30−-- > import qualified Data.Text.Lazy as B
30+-- > import qualified Data.Text.Lazy as L
31
31
32module Data.Text.Lazy
32module Data.Text.Lazy
33 (
33 (
@@ -518,6 +518,9 @@ reverse = rev Empty
518 rev a (Chunk t ts) = rev (Chunk (T.reverse t) a) ts
518 rev a (Chunk t ts) = rev (Chunk (T.reverse t) a) ts
519
519
520-- | /O(m+n)/ Replace every occurrence of one substring with another.
520-- | /O(m+n)/ Replace every occurrence of one substring with another.
521+--
522+-- In (unlikely) bad cases, this function's time complexity degrades
523+-- towards /O(n*m)/.
521replace :: Text -- ^ Text to search for
524replace :: Text -- ^ Text to search for
522 -> Text -- ^ Replacement text
525 -> Text -- ^ Replacement text
523 -> Text -- ^ Input text
526 -> Text -- ^ Input text