Hoogle Search

Within LTS Haskell 24.3 (ghc-9.10.2)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. decodeUtf8More :: Utf8State -> ByteString -> (StrictTextBuilder, ByteString, Maybe Utf8State)

    text Data.Text.Internal.Encoding

    Decode another chunk in an ongoing UTF-8 stream. Returns a triple:

    1. A StrictBuilder for the decoded chunk of text. You can accumulate chunks with (<>) or output them with toText.
    2. The undecoded remainder of the given chunk, for diagnosing errors and resuming (presumably after skipping some bytes).
    3. Just the new state, or Nothing if an invalid byte was encountered (it will be within the first 4 bytes of the undecoded remainder).

    Properties

    Given:
    (pre, suf, ms) = decodeUtf8More s chunk
    
    1. If the output pre is nonempty (alternatively, if length chunk > length suf)
      s2b pre `append` suf
      = p2b s `append` chunk 
      where
      s2b = encodeUtf8
      . toText p2b = partUtf8ToByteString 
    2. If the output pre is empty (alternatively, if length chunk = length suf)
      suf = chunk
    3. Decoding chunks separately is equivalent to decoding their concatenation.Given:
      (pre1, suf1, Just s1) = decodeUtf8More
      s chunk1 (pre2, suf2, ms2) = decodeUtf8More s1 chunk2 (pre3,
      suf3, ms3) = decodeUtf8More s (chunk1 `B.append` chunk2)
      
      we have:
      s2b (pre1 <> pre2) = s2b pre3 ms2 =
      ms3 

  2. decodeUtf8With1 :: OnDecodeError -> String -> ByteString -> Text

    text Data.Text.Internal.Encoding

    Helper for decodeUtf8With.

  3. decodeUtf8With2 :: OnDecodeError -> String -> Utf8State -> ByteString -> (StrictTextBuilder, ByteString, Utf8State)

    text Data.Text.Internal.Encoding

    Helper for decodeUtf8With, streamDecodeUtf8With, and lazy decodeUtf8With, which use an OnDecodeError to process bad bytes. See decodeUtf8Chunk for a more flexible alternative.

  4. decodeUtf8' :: ByteString -> Either UnicodeException Text

    text Data.Text.Lazy.Encoding

    Decode a ByteString containing UTF-8 encoded text.. If the input contains any invalid UTF-8 data, the relevant exception will be returned, otherwise the decoded text. Note: this function is not lazy, as it must decode its entire input before it can return a result. If you need lazy (streaming) decoding, use decodeUtf8With in lenient mode.

  5. decodeUtf8With :: OnDecodeError -> ByteString -> Text

    text Data.Text.Lazy.Encoding

    Decode a ByteString containing UTF-8 encoded text.

  6. decodeUtf8C :: forall (m :: Type -> Type) . MonadThrow m => ConduitT ByteString Text m ()

    conduit Conduit

    Decode a stream of binary data as UTF8.

  7. decodeUtf8LenientC :: forall (m :: Type -> Type) . Monad m => ConduitT ByteString Text m ()

    conduit Conduit

    Decode a stream of binary data as UTF8, replacing any invalid bytes with the Unicode replacement character.

  8. decodeUtf8Lenient :: forall (m :: Type -> Type) . Monad m => ConduitT ByteString Text m ()

    conduit Data.Conduit.Combinators

    Decode a stream of binary data as UTF8, replacing any invalid bytes with the Unicode replacement character.

  9. decodeUtf8Lenient :: forall (m :: Type -> Type) . Monad m => ConduitT ByteString Text m ()

    conduit-extra Data.Conduit.Text

    Decode a stream of binary data as UTF8, replacing any invalid bytes with the Unicode replacement character.

  10. decodeUtf8Pure :: ByteString -> DecodeResult

    streaming-commons Data.Streaming.Text

    O(n) Convert a ByteString into a 'Stream Char', using UTF-8 encoding.

Page 4 of many | Previous | Next