@@ -213,7 +213,7 @@ import qualified Data.Text.Internal.Fusion as S
213213import qualified Data.Text.Internal.Fusion.Common as S
214214import Data.Text.Internal.Fusion (stream, reverseStream, unstream)
215215import Data.Text.Internal.Private (span_)
216−import Data.Text.Internal (Text(..), empty, firstf, safe, textP)
216+import Data.Text.Internal (Text(..), empty, firstf, safe, text)
217217import qualified Prelude as P
218218import Data.Text.Unsafe (Iter(..), iter, iter_, lengthWord16, reverseIter,
219219 reverseIter_, unsafeHead, unsafeTail)
@@ -452,7 +452,7 @@ head t = S.head (stream t)
452452uncons :: Text -> Maybe (Char, Text)
453453uncons t@(Text arr off len)
454454 | len <= 0 = Nothing
455− | otherwise = Just (c, textP arr (off+d) (len-d))
455+ | otherwise = Just (c, text arr (off+d) (len-d))
456456 where Iter c d = iter t 0
457457{-# INLINE [1] uncons #-}
458458
@@ -483,7 +483,7 @@ last (Text arr off len)
483483tail :: Text -> Text
484484tail t@(Text arr off len)
485485 | len <= 0 = emptyError "tail"
486− | otherwise = textP arr (off+d) (len-d)
486+ | otherwise = text arr (off+d) (len-d)
487487 where d = iter_ t 0
488488{-# INLINE [1] tail #-}
489489
@@ -498,8 +498,8 @@ tail t@(Text arr off len)
498498-- be non-empty. Subject to fusion.
499499init :: Text -> Text
500500init (Text arr off len) | len <= 0 = emptyError "init"
501− | n >= 0xDC00 && n <= 0xDFFF = textP arr off (len-2)
502− | otherwise = textP arr off (len-1)
501+ | n >= 0xDC00 && n <= 0xDFFF = text arr off (len-2)
502+ | otherwise = text arr off (len-1)
503503 where
504504 n = A.unsafeIndex arr (off+len-1)
505505{-# INLINE [1] init #-}
@@ -1004,7 +1004,7 @@ take :: Int -> Text -> Text
10041004take n t@(Text arr off len)
10051005 | n <= 0 = empty
10061006 | n >= len = t
1007− | otherwise = textP arr off (iterN n t)
1007+ | otherwise = text arr off (iterN n t)
10081008{-# INLINE [1] take #-}
10091009
10101010iterN :: Int -> Text -> Int
@@ -1031,7 +1031,7 @@ takeEnd :: Int -> Text -> Text
10311031takeEnd n t@(Text arr off len)
10321032 | n <= 0 = empty
10331033 | n >= len = t
1034− | otherwise = textP arr (off+i) (len-i)
1034+ | otherwise = text arr (off+i) (len-i)
10351035 where i = iterNEnd n t
10361036
10371037iterNEnd :: Int -> Text -> Int
@@ -1049,7 +1049,7 @@ drop :: Int -> Text -> Text
10491049drop n t@(Text arr off len)
10501050 | n <= 0 = t
10511051 | n >= len = empty
1052− | otherwise = textP arr (off+i) (len-i)
1052+ | otherwise = text arr (off+i) (len-i)
10531053 where i = iterN n t
10541054{-# INLINE [1] drop #-}
10551055
@@ -1070,7 +1070,7 @@ dropEnd :: Int -> Text -> Text
10701070dropEnd n t@(Text arr off len)
10711071 | n <= 0 = t
10721072 | n >= len = empty
1073− | otherwise = textP arr off (iterNEnd n t)
1073+ | otherwise = text arr off (iterNEnd n t)
10741074
10751075-- | /O(n)/ 'takeWhile', applied to a predicate @p@ and a 'Text',
10761076-- returns the longest prefix (possibly empty) of elements that
@@ -1079,7 +1079,7 @@ takeWhile :: (Char -> Bool) -> Text -> Text
10791079takeWhile p t@(Text arr off len) = loop 0
10801080 where loop !i | i >= len = t
10811081 | p c = loop (i+d)
1082− | otherwise = textP arr off i
1082+ | otherwise = text arr off i
10831083 where Iter c d = iter t i
10841084{-# INLINE [1] takeWhile #-}
10851085
@@ -1165,7 +1165,7 @@ splitAt n t@(Text arr off len)
11651165 | n <= 0 = (empty, t)
11661166 | n >= len = (t, empty)
11671167 | otherwise = let k = iterN n t
1168− in (textP arr off k, textP arr (off+k) (len-k))
1168+ in (text arr off k, text arr (off+k) (len-k))
11691169
11701170-- | /O(n)/ 'span', applied to a predicate @p@ and text @t@, returns
11711171-- a pair whose first element is the longest prefix (possibly empty)
@@ -1188,7 +1188,7 @@ groupBy p = loop
11881188 where
11891189 loop t@(Text arr off len)
11901190 | null t = []
1191− | otherwise = textP arr off n : loop (textP arr (off+n) (len-n))
1191+ | otherwise = text arr off n : loop (text arr (off+n) (len-n))
11921192 where Iter c d = iter t 0
11931193 n = d + findAIndexOrEnd (not . p c) (Text arr (off+d) (len-d))
11941194
@@ -1247,8 +1247,8 @@ splitOn pat@(Text _ _ l) src@(Text arr off len)
12471247 | isSingleton pat = split (== unsafeHead pat) src
12481248 | otherwise = go 0 (indices pat src)
12491249 where
1250− go !s (x:xs) = textP arr (s+off) (x-s) : go (x+l) xs
1251− go s _ = [textP arr (s+off) (len-s)]
1250+ go !s (x:xs) = text arr (s+off) (x-s) : go (x+l) xs
1251+ go s _ = [text arr (s+off) (len-s)]
12521252{-# INLINE [1] splitOn #-}
12531253
12541254{-# RULES
@@ -1340,7 +1340,7 @@ breakOn pat src@(Text arr off len)
13401340 | null pat = emptyError "breakOn"
13411341 | otherwise = case indices pat src of
13421342 [] -> (src, empty)
1343− (x:_) -> (textP arr off x, textP arr (off+x) (len-x))
1343+ (x:_) -> (text arr off x, text arr (off+x) (len-x))
13441344{-# INLINE breakOn #-}
13451345
13461346-- | /O(n+m)/ Similar to 'breakOn', but searches from the end of the
@@ -1382,7 +1382,7 @@ breakOnAll pat src@(Text arr off slen)
13821382 | otherwise = L.map step (indices pat src)
13831383 where
13841384 step x = (chunk 0 x, chunk x (slen-x))
1385− chunk !n !l = textP arr (n+off) l
1385+ chunk !n !l = text arr (n+off) l
13861386{-# INLINE breakOnAll #-}
13871387
13881388-------------------------------------------------------------------------------
@@ -1582,7 +1582,7 @@ isInfixOf needle haystack
15821582-- > fnordLength _ = -1
15831583stripPrefix :: Text -> Text -> Maybe Text
15841584stripPrefix p@(Text _arr _off plen) t@(Text arr off len)
1585− | p `isPrefixOf` t = Just $! textP arr (off+plen) (len-plen)
1585+ | p `isPrefixOf` t = Just $! text arr (off+plen) (len-plen)
15861586 | otherwise = Nothing
15871587
15881588-- | /O(n)/ Find the longest non-empty common prefix of two strings
@@ -1602,8 +1602,8 @@ commonPrefixes t0@(Text arr0 off0 len0) t1@(Text arr1 off1 len1) = go 0 0
16021602 where
16031603 go !i !j | i < len0 && j < len1 && a == b = go (i+d0) (j+d1)
16041604 | i > 0 = Just (Text arr0 off0 i,
1605− textP arr0 (off0+i) (len0-i),
1606− textP arr1 (off1+j) (len1-j))
1605+ text arr0 (off0+i) (len0-i),
1606+ text arr1 (off1+j) (len1-j))
16071607 | otherwise = Nothing
16081608 where Iter a d0 = iter t0 i
16091609 Iter b d1 = iter t1 j
@@ -1628,7 +1628,7 @@ commonPrefixes t0@(Text arr0 off0 len0) t1@(Text arr1 off1 len1) = go 0 0
16281628-- > quuxLength _ = -1
16291629stripSuffix :: Text -> Text -> Maybe Text
16301630stripSuffix p@(Text _arr _off plen) t@(Text arr off len)
1631− | p `isSuffixOf` t = Just $! textP arr off (len-plen)
1631+ | p `isSuffixOf` t = Just $! text arr off (len-plen)
16321632 | otherwise = Nothing
16331633
16341634-- | Add a list of non-negative numbers. Errors out on overflow.