@@ -213,6 +213,8 @@ decodeUtf8With onErr (PS fp off len) = runText $ \done -> do
213-- or continuation where it is encountered.
213-- or continuation where it is encountered.
215-- | A stream oriented decoding result.
215-- | A stream oriented decoding result.
216data Decoding = Some Text ByteString (ByteString -> Decoding)
218data Decoding = Some Text ByteString (ByteString -> Decoding)
218instance Show Decoding where
220instance Show Decoding where
@@ -232,11 +234,15 @@ newtype DecoderState = DecoderState Word32 deriving (Eq, Show, Num, Storable)
232-- thrown (either by this function or a continuation) that cannot be
234-- thrown (either by this function or a continuation) that cannot be
233-- caught in pure code. For more control over the handling of invalid
235-- caught in pure code. For more control over the handling of invalid
234-- data, use 'streamDecodeUtf8With'.
236-- data, use 'streamDecodeUtf8With'.
235streamDecodeUtf8 :: ByteString -> Decoding
239streamDecodeUtf8 :: ByteString -> Decoding
236streamDecodeUtf8 = streamDecodeUtf8With strictDecode
240streamDecodeUtf8 = streamDecodeUtf8With strictDecode
238-- | Decode, in a stream oriented way, a 'ByteString' containing UTF-8
242-- | Decode, in a stream oriented way, a 'ByteString' containing UTF-8
239-- encoded text.
243-- encoded text.
240streamDecodeUtf8With :: OnDecodeError -> ByteString -> Decoding
246streamDecodeUtf8With :: OnDecodeError -> ByteString -> Decoding
241streamDecodeUtf8With onErr = decodeChunk B.empty 0 0
247streamDecodeUtf8With onErr = decodeChunk B.empty 0 0