ShortByteString

A compact representation of a Word8 vector. It has a lower memory overhead than a ByteString and does not contribute to heap fragmentation. It can be converted to or from a ByteString (at the cost of copying the string data). It supports very few other operations.
A compact representation of a Word8 vector. It has a lower memory overhead than a ByteString and does not contribute to heap fragmentation. It can be converted to or from a ByteString (at the cost of copying the string data). It supports very few other operations.
A compact representation of a Word8 vector. It has a lower memory overhead than a ByteString and and does not contribute to heap fragmentation. It can be converted to or from a ByteString (at the cost of copying the string data). It supports very few other operations. It is suitable for use as an internal representation for code that needs to keep many short strings in memory, but it should not be used as an interchange type. That is, it should not generally be used in public APIs. The ByteString type is usually more suitable for use in interfaces; it is more flexible and it supports a wide range of operations.
A compact representation of a Word8 vector. It has a lower memory overhead than a ByteString and does not contribute to heap fragmentation. It can be converted to or from a ByteString (at the cost of copying the string data). It supports very few other operations.
A compact representation of a Word8 vector. It has a lower memory overhead than a ByteString and does not contribute to heap fragmentation. It can be converted to or from a ByteString (at the cost of copying the string data). It supports very few other operations. It is suitable for use as an internal representation for code that needs to keep many short strings in memory, but it should not be used as an interchange type. That is, it should not generally be used in public APIs. The ByteString type is usually more suitable for use in interfaces; it is more flexible and it supports a wide range of operations.
Construct a Builder that copies the ShortByteString.
Create a builder from a short bytestring. Implemented with bytes.
Serialize a ShortByteString. Must be a monoid homomorphism.
Write a ShortByteString.
Not on Stackage, so not searched. Additional ShortByteString API
Bytes of a short bytestring
Bytes of a short bytestring
Bytes of a short bytestring
Deprecated: In favor of uniformShortByteString
Same as uniformByteArray False, but for ShortByteString. Returns a ShortByteString of length n filled with pseudo-random bytes.

Examples

>>> import System.Random

>>> import Data.ByteString.Short (unpack)

>>> let pureGen = mkStdGen 137

>>> unpack . fst $ uniformShortByteString 10 pureGen
[51,123,251,37,49,167,90,109,1,4]
Deprecated: In favor of fillByteArrayST
Deprecated: In favor of fillByteArrayST, since uniformShortByteString, which it was used for, was also deprecated
Deprecated: In favor of uniformShortByteStringM
uniformShortByteString n g generates a ShortByteString of length n filled with pseudo-random bytes.
O(n). A builder taking ShortByteString and copy it to a Builder, satisfying