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.
fromByteString :: ByteString -> Maybe ShortTexttext-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.
fromShortByteString :: ShortByteString -> Maybe ShortTexttext-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
toByteString :: ShortText -> ByteStringtext-short Data.Text.Short Converts to UTF-8 encoded ByteString
toShortByteString :: ShortText -> ShortByteStringtext-short Data.Text.Short Converts to UTF-8 encoded ShortByteString This operation has effectively no overhead, as it's currently merely a newtype-cast.
fromByteStringUnsafe :: ByteString -> ShortTexttext-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.
fromShortByteStringUnsafe :: ShortByteString -> ShortTexttext-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.
fromByteString :: ByteString -> Maybe UUIDuuid-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.
toByteString :: UUID -> ByteStringuuid-types Data.UUID.Types Encode a UUID into a ByteString in network order. This uses the same encoding as the Binary instance.
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.
newByteStringBuilderRecv :: BufferAllocStrategy -> IO (BuilderRecv, BuilderFinish)streaming-commons Data.Streaming.ByteString.Builder No documentation available.