Hoogle Search

Within LTS Haskell 24.64 (ghc-9.10.3)

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

  1. 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
    

  2. toByteString :: ShortText -> ByteString

    text-short Data.Text.Short

    Converts to UTF-8 encoded ByteString

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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.

  8. 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.

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

    streaming-commons Data.Streaming.ByteString.Builder

    No documentation available.

  10. toByteStringIO :: (ByteString -> IO ()) -> Builder -> IO ()

    streaming-commons Data.Streaming.ByteString.Builder

    Run the builder with a defaultChunkSized buffer and execute the given IO action whenever the buffer is full or gets flushed.

    toByteStringIO = toByteStringIOWith defaultChunkSize
    
    Since 0.1.9

Page 34 of many | Previous | Next