@@ -42,7 +42,7 @@ module Data.Text.Encoding
42 , encodeUtf32LE
42 , encodeUtf32LE
43 , encodeUtf32BE
43 , encodeUtf32BE
46import Data.Bits ((.&.))
46import Data.Bits ((.&.))
47import Data.ByteString as B
47import Data.ByteString as B
48import Data.ByteString.Internal as B
48import Data.ByteString.Internal as B
@@ -110,12 +110,15 @@ decodeUtf8With' onErr bs = textP (fst a) 0 (snd a)
110 w <- unsafeWrite arr n c
110 w <- unsafeWrite arr n c
111 go (n+w) (m+1)
111 go (n+w) (m+1)
112 desc = "Data.Text.Encoding.encodeUtf8: Invalid UTF-8 stream"
112 desc = "Data.Text.Encoding.encodeUtf8: Invalid UTF-8 stream"
113−{-# INLINE decodeUtf8With' #-}
113+{-# INLINE[0] decodeUtf8With' #-}
115-- | Decode a 'ByteString' containing UTF-8 encoded text.
115-- | Decode a 'ByteString' containing UTF-8 encoded text.
116decodeUtf8' :: ByteString -> Text
116decodeUtf8' :: ByteString -> Text
117decodeUtf8' = decodeUtf8With' strictDecode
117decodeUtf8' = decodeUtf8With' strictDecode
118−{-# INLINE decodeUtf8' #-}
118+{-# INLINE[0] decodeUtf8' #-}
120+{-# RULES "STREAM stream/decodeUtf8' fusion" [1]
121+ forall bs. F.stream (decodeUtf8' bs) = E.streamUtf8 strictDecode bs #-}
120-- | Encode text using UTF-8 encoding.
123-- | Encode text using UTF-8 encoding.
121encodeUtf8 :: Text -> ByteString
124encodeUtf8 :: Text -> ByteString