on master help sign in
Merge pull request #185 from steshaw/master

Data.Text.Lazy.cons is O(1) rather than O(n)

commit3124ea8f38665875c89832b343fcd696d9417055 authorBryan O'Sullivan <bos@serpentine.com> dateTue 27 Jun 2017, 01:19 (9 years ago) parent054d273cb727b3
1 file changed+1−3
Data/Text/Lazy.hs+1−3
Data/Text/Lazy.hs+1−3
@@ -475,9 +475,7 @@ fromStrict t = chunk t Empty
475475-- -----------------------------------------------------------------------------
476476-- * Basic functions
477477
478−-- | /O(n)/ Adds a character to the front of a 'Text'. This function
479−-- is more costly than its 'List' counterpart because it requires
480−-- copying a new array. Subject to fusion.
478+-- | /O(1)/ Adds a character to the front of a 'Text'. Subject to fusion.
481479cons :: Char -> Text -> Text
482480cons c t = Chunk (T.singleton c) t
483481{-# INLINE [1] cons #-}