Hoogle Search

Within LTS Haskell 24.43 (ghc-9.10.3)

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

  1. fromByteString :: ByteString -> Maybe ShortText

    text-short Data.Text.Short

    Construct ShortText from UTF-8 encoded ByteString fromByteString accepts (or rejects) the same input data as fromShortByteString. Returns Nothing in case of invalid UTF-8 encoding.

  2. fromShortByteString :: ShortByteString -> Maybe ShortText

    text-short Data.Text.Short

    Construct ShortText from UTF-8 encoded ShortByteString This operation doesn't copy the input ShortByteString but it cannot be <math> because we need to validate the UTF-8 encoding. Returns Nothing in case of invalid UTF-8 encoding.

    >>> fromShortByteString "\x00\x38\xF0\x90\x8C\x9A" -- U+00 U+38 U+1031A
    Just "\NUL8\66330"
    
    >>> fromShortByteString "\xC0\x80" -- invalid denormalised U+00
    Nothing
    
    >>> fromShortByteString "\xED\xA0\x80" -- U+D800 (non-scalar code-point)
    Nothing
    
    >>> fromShortByteString "\xF4\x8f\xbf\xbf" -- U+10FFFF
    Just "\1114111"
    
    >>> fromShortByteString "\xF4\x90\x80\x80" -- U+110000 (invalid)
    Nothing
    
    fromShortByteString (toShortByteString t) == Just t
    

  3. toByteString :: ShortText -> ByteString

    text-short Data.Text.Short

    Converts to UTF-8 encoded ByteString

  4. toShortByteString :: ShortText -> ShortByteString

    text-short Data.Text.Short

    Converts to UTF-8 encoded ShortByteString This operation has effectively no overhead, as it's currently merely a newtype-cast.

  5. fromByteStringUnsafe :: ByteString -> ShortText

    text-short Data.Text.Short.Unsafe

    Construct ShortText from UTF-8 encoded ByteString This operation is <math> because the ByteString needs to be copied into an unpinned ByteArray#. WARNING: Unlike the safe fromByteString conversion, this conversion is unsafe as it doesn't validate the well-formedness of the UTF-8 encoding.

  6. fromShortByteStringUnsafe :: ShortByteString -> ShortText

    text-short Data.Text.Short.Unsafe

    Construct ShortText from UTF-8 encoded ShortByteString This operation has effectively no overhead, as it's currently merely a newtype-cast. WARNING: Unlike the safe fromShortByteString conversion, this conversion is unsafe as it doesn't validate the well-formedness of the UTF-8 encoding.

  7. fromByteString :: ByteString -> Maybe UUID

    uuid-types Data.UUID.Types

    Extract a UUID from a ByteString in network byte order. The argument must be 16 bytes long, otherwise Nothing is returned.

  8. toByteString :: UUID -> ByteString

    uuid-types Data.UUID.Types

    Encode a UUID into a ByteString in network order. This uses the same encoding as the Binary instance.

  9. digestFromByteString :: (HashAlgorithm a, ByteArrayAccess ba) => ba -> Maybe (Digest a)

    cryptonite Crypto.Hash

    Try to transform a bytearray into a Digest of specific algorithm. If the digest is not the right size for the algorithm specified, then Nothing is returned.

  10. newByteStringBuilderRecv :: BufferAllocStrategy -> IO (BuilderRecv, BuilderFinish)

    streaming-commons Data.Streaming.ByteString.Builder

    No documentation available.

Page 43 of many | Previous | Next