Data.ByteString
- Package
- purescript-bytestrings
- Repository
- rightfold/purescript-bytestrings
#ByteString Source
#unsafeFreeze Source
unsafeFreeze :: Buffer -> ByteStringO(1) The result points directly into the buffer. Mutating the buffer afterwards results in undefined behavior.
#unsafeThaw Source
unsafeThaw :: ByteString -> BufferO(1) The result points directly into the byte string. Mutating the buffer results in undefined behavior.
#empty Source
empty :: ByteStringO(1) The empty byte string.
#singleton Source
singleton :: Octet -> ByteStringO(1) A byte string with a single byte.
#unsafeIndex Source
unsafeIndex :: ByteString -> Int -> OctetO(1) Get the nth byte. If the index is out of bounds, the behavior is undefined.
#cons Source
cons :: Octet -> ByteString -> ByteStringΘ(n) Prepend a byte.
#snoc Source
snoc :: ByteString -> Octet -> ByteStringΘ(n) Append a byte.
#uncons Source
uncons :: ByteString -> Maybe { head :: Octet, tail :: ByteString }Θ(n) Unprepend a byte.
#unsnoc Source
unsnoc :: ByteString -> Maybe { init :: ByteString, last :: Octet }Θ(n) Unappend a byte.
#tail Source
tail :: ByteString -> Maybe ByteStringΘ(n) Get all but the first byte.
#init Source
init :: ByteString -> Maybe ByteStringΘ(n) Get all but the last byte.
#length Source
length :: ByteString -> IntO(1) How many bytes are in this byte string?
#isEmpty Source
isEmpty :: ByteString -> BooleanO(1) Check if a byte string is empty.
#map Source
map :: (Octet -> Octet) -> ByteString -> ByteStringΘ(n) Transform the bytes in the byte string.
#reverse Source
reverse :: ByteString -> ByteStringΘ(n) Reverse the byte string.
#foldableOfOctet Source
foldableOfOctet :: forall a. Foldable a -> a ~ OctetO(1) Witness that foldable byte strings can only contain octets.
#foldl Source
foldl :: forall a. (a -> Octet -> a) -> a -> ByteString -> aΘ(n) Fold a byte string.
#foldr Source
foldr :: forall a. (Octet -> a -> a) -> a -> ByteString -> aΘ(n) Fold a byte string.
#fromString Source
fromString :: String -> Encoding -> ByteStringΘ(n) Encode a string.
#toUTF8 Source
toUTF8 :: String -> ByteStringΘ(n) flip fromString UTF8.
#fromUTF8 Source
fromUTF8 :: ByteString -> StringΘ(n) flip toString UTF8