@@ -22,14 +22,12 @@ module Data.Text.Encoding
2222 -- * Decoding ByteStrings to Text
2323 decodeASCII
2424 , decodeUtf8
25− , decodeUtf8'
2625 , decodeUtf16LE
2726 , decodeUtf16BE
2827 , decodeUtf32LE
2928 , decodeUtf32BE
3029 -- ** Controllable error handling
3130 , decodeUtf8With
32− , decodeUtf8With'
3331 , decodeUtf16LEWith
3432 , decodeUtf16BEWith
3533 , decodeUtf32LEWith
@@ -67,18 +65,8 @@ decodeASCII :: ByteString -> Text
6765decodeASCII bs = F.unstream (E.streamASCII bs)
6866{-# INLINE decodeASCII #-}
6967
70−-- | Decode a 'ByteString' containing UTF-8 encoded text.
7168decodeUtf8With :: OnDecodeError -> ByteString -> Text
72−decodeUtf8With onErr bs = F.unstream (E.streamUtf8 onErr bs)
73−{-# INLINE decodeUtf8With #-}
74−
75−-- | Decode a 'ByteString' containing UTF-8 encoded text.
76−decodeUtf8 :: ByteString -> Text
77−decodeUtf8 = decodeUtf8With strictDecode
78−{-# INLINE decodeUtf8 #-}
79−
80−decodeUtf8With' :: OnDecodeError -> ByteString -> Text
81−decodeUtf8With' onErr bs = textP (fst a) 0 (snd a)
69+decodeUtf8With onErr bs = textP (fst a) 0 (snd a)
8270 where
8371 a = A.run2 (A.new len >>= outer 0 0)
8472 len = B.length bs
@@ -109,16 +97,16 @@ decodeUtf8With' onErr bs = textP (fst a) 0 (snd a)
10997 Just c -> do
11098 w <- unsafeWrite arr n c
11199 go (n+w) (m+1)
112− desc = "Data.Text.Encoding.encodeUtf8: Invalid UTF-8 stream"
113−{-# INLINE[0] decodeUtf8With' #-}
100+ desc = "Data.Text.Encoding.decodeUtf8: Invalid UTF-8 stream"
101+{-# INLINE[0] decodeUtf8With #-}
114102
115103-- | Decode a 'ByteString' containing UTF-8 encoded text.
116−decodeUtf8' :: ByteString -> Text
117−decodeUtf8' = decodeUtf8With' strictDecode
118−{-# INLINE[0] decodeUtf8' #-}
104+decodeUtf8 :: ByteString -> Text
105+decodeUtf8 = decodeUtf8With strictDecode
106+{-# INLINE[0] decodeUtf8 #-}
119107
120−{-# RULES "STREAM stream/decodeUtf8' fusion" [1]
121− forall bs. F.stream (decodeUtf8' bs) = E.streamUtf8 strictDecode bs #-}
108+{-# RULES "STREAM stream/decodeUtf8 fusion" [1]
109+ forall bs. F.stream (decodeUtf8 bs) = E.streamUtf8 strictDecode bs #-}
122110
123111-- | Encode text using UTF-8 encoding.
124112encodeUtf8 :: Text -> ByteString