@@ -20,14 +20,12 @@ module Data.Text.Lazy.Encoding
2020 -- * Decoding ByteStrings to Text
2121 decodeASCII
2222 , decodeUtf8
23− , decodeUtf8'
2423 , decodeUtf16LE
2524 , decodeUtf16BE
2625 , decodeUtf32LE
2726 , decodeUtf32BE
2827 -- ** Controllable error handling
2928 , decodeUtf8With
30− , decodeUtf8With'
3129 , decodeUtf16LEWith
3230 , decodeUtf16BEWith
3331 , decodeUtf32LEWith
@@ -60,17 +58,7 @@ decodeASCII bs = foldr (chunk . TE.decodeASCII) empty (B.toChunks bs)
6058
6159-- | Decode a 'ByteString' containing UTF-8 encoded text.
6260decodeUtf8With :: OnDecodeError -> B.ByteString -> Text
63−decodeUtf8With onErr bs = F.unstream (E.streamUtf8 onErr bs)
64−{-# INLINE decodeUtf8With #-}
65−
66−-- | Decode a 'ByteString' containing UTF-8 encoded text.
67−decodeUtf8 :: B.ByteString -> Text
68−decodeUtf8 = decodeUtf8With strictDecode
69−{-# INLINE decodeUtf8 #-}
70−
71−-- | Decode a 'ByteString' containing UTF-8 encoded text.
72−decodeUtf8With' :: OnDecodeError -> B.ByteString -> Text
73−decodeUtf8With' onErr bs0 = fast bs0
61+decodeUtf8With onErr bs0 = fast bs0
7462 where
7563 decode = TE.decodeUtf8With onErr
7664 fast (B.Chunk p ps) | isComplete p = chunk (decode p) (fast ps)
@@ -104,12 +92,12 @@ decodeUtf8With' onErr bs0 = fast bs0
10492 where len = S.length bs
10593 ix n = S.unsafeIndex bs (len-n)
10694 desc = "Data.Text.Lazy.Encoding.decodeUtf8With: Invalid UTF-8 stream"
107−{-# INLINE[0] decodeUtf8With' #-}
95+{-# INLINE[0] decodeUtf8With #-}
10896
10997-- | Decode a 'ByteString' containing UTF-8 encoded text.
110−decodeUtf8' :: B.ByteString -> Text
111−decodeUtf8' = decodeUtf8With' strictDecode
112−{-# INLINE[0] decodeUtf8' #-}
98+decodeUtf8 :: B.ByteString -> Text
99+decodeUtf8 = decodeUtf8With strictDecode
100+{-# INLINE[0] decodeUtf8 #-}
113101
114102-- This rule seems to cause performance loss.
115103{- RULES "LAZY STREAM stream/decodeUtf8' fusion" [1]