Hoogle Search

Within LTS Haskell 24.62 (ghc-9.10.3)

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

  1. validateUtf8More :: Utf8State -> ByteString -> (Int, Maybe Utf8State)

    text Data.Text.Internal.Encoding

    Validate another ByteString chunk in an ongoing stream of UTF-8-encoded text. Returns a pair:

    1. The first component n is the end position, relative to the current chunk, of the longest prefix of the accumulated bytestring which is valid UTF-8. n may be negative: that happens when an incomplete code point started in a previous chunk and is not completed by the current chunk (either that code point is still incomplete, or it is broken by an invalid byte).
    2. The second component ms indicates the following:
      • if ms = Nothing, the remainder of the chunk contains an invalid byte, within four bytes from position n;
      • if ms = Just s', you can carry on validating another chunk by calling validateUtf8More with the new state s'.

    Properties

    Given:
    validateUtf8More s chunk = (n, ms)
    

  2. validate1 :: Word16 -> Bool

    text Data.Text.Internal.Encoding.Utf16

    No documentation available.

  3. validate2 :: Word16 -> Word16 -> Bool

    text Data.Text.Internal.Encoding.Utf16

    No documentation available.

  4. validate :: Word32 -> Bool

    text Data.Text.Internal.Encoding.Utf32

    No documentation available.

  5. validate1 :: Word8 -> Bool

    text Data.Text.Internal.Encoding.Utf8

    No documentation available.

  6. validate2 :: Word8 -> Word8 -> Bool

    text Data.Text.Internal.Encoding.Utf8

    No documentation available.

  7. validate3 :: Word8 -> Word8 -> Word8 -> Bool

    text Data.Text.Internal.Encoding.Utf8

    No documentation available.

  8. validate4 :: Word8 -> Word8 -> Word8 -> Word8 -> Bool

    text Data.Text.Internal.Encoding.Utf8

    No documentation available.

  9. module Data.Text.Internal.Validate

    Test whether or not a sequence of bytes is a valid UTF-8 byte sequence. In the GHC Haskell ecosystem, there are several representations of byte sequences. The only one that the stable text API concerns itself with is ByteString. Part of bytestring-to-text decoding is isValidUtf8ByteString, a high-performance UTF-8 validation routine written in C++ with fallbacks for various platforms. The C++ code backing this routine is nontrivial, so in the interest of reuse, this module additionally exports functions for working with the GC-managed ByteArray type. These ByteArray functions are not used anywhere else in text. They are for the benefit of library and application authors who do not use ByteString but still need to interoperate with text.

  10. isValidUtf8ByteArray :: ByteArray -> Int -> Int -> Bool

    text Data.Text.Internal.Validate

    For pinned byte arrays larger than 128KiB, this switches to the safe FFI so that it does not prevent GC. This threshold (128KiB) was chosen somewhat arbitrarily and may change in the future.

Page 370 of many | Previous | Next