Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Bytes = Bytes {
- underlying :: Rope Chunk
- type Chunk = Vector Word8
- fromByteString :: ByteString -> Bytes
- toByteString :: Bytes -> ByteString
- fromWord8s :: [Word8] -> Bytes
- toWord8s :: Bytes -> [Word8]
- fromBase16 :: Bytes -> Either Text Bytes
- toBase16 :: Bytes -> Bytes
- fromBase32 :: Bytes -> Either Text Bytes
- toBase32 :: Bytes -> Bytes
- fromBase64 :: Bytes -> Either Text Bytes
- toBase64 :: Bytes -> Bytes
- fromBase64UrlUnpadded :: Bytes -> Either Text Bytes
- toBase64UrlUnpadded :: Bytes -> Bytes
- chunkFromByteString :: ByteString -> Chunk
- byteStringToChunk :: ByteString -> Chunk
- chunkToByteString :: Chunk -> ByteString
- fromChunks :: [Chunk] -> Bytes
- chunks :: Bytes -> [Chunk]
- byteStringChunks :: Bytes -> [ByteString]
- toArray :: ByteArray b => Bytes -> b
- fromArray :: ByteArrayAccess b => b -> Bytes
- toLazyByteString :: Bytes -> ByteString
- flatten :: Bytes -> Bytes
- at :: Int -> Bytes -> Maybe Word8
- take :: Int -> Bytes -> Bytes
- drop :: Int -> Bytes -> Bytes
- indexOf :: Bytes -> Bytes -> Maybe Word64
- size :: Bytes -> Int
- empty :: Bytes
- encodeNat16be :: Word64 -> Bytes
- decodeNat16be :: Bytes -> Maybe (Word64, Bytes)
- encodeNat32be :: Word64 -> Bytes
- decodeNat32be :: Bytes -> Maybe (Word64, Bytes)
- encodeNat64be :: Word64 -> Bytes
- decodeNat64be :: Bytes -> Maybe (Word64, Bytes)
- encodeNat16le :: Word64 -> Bytes
- decodeNat16le :: Bytes -> Maybe (Word64, Bytes)
- encodeNat32le :: Word64 -> Bytes
- decodeNat32le :: Bytes -> Maybe (Word64, Bytes)
- encodeNat64le :: Word64 -> Bytes
- decodeNat64le :: Bytes -> Maybe (Word64, Bytes)
- decodeUtf8 :: ByteString -> Text
- encodeUtf8 :: Text -> ByteString
- zlibCompress :: Bytes -> Bytes
- zlibDecompress :: Bytes -> Bytes
- gzipCompress :: Bytes -> Bytes
- gzipDecompress :: Bytes -> Bytes
Documentation
Bytes | |
|
fromByteString :: ByteString -> Bytes Source #
toByteString :: Bytes -> ByteString Source #
fromWord8s :: [Word8] -> Bytes Source #
toBase64UrlUnpadded :: Bytes -> Bytes Source #
byteStringToChunk :: ByteString -> Chunk Source #
chunkToByteString :: Chunk -> ByteString Source #
fromChunks :: [Chunk] -> Bytes Source #
byteStringChunks :: Bytes -> [ByteString] Source #
fromArray :: ByteArrayAccess b => b -> Bytes Source #
toLazyByteString :: Bytes -> ByteString Source #
encodeNat16be :: Word64 -> Bytes Source #
encodeNat32be :: Word64 -> Bytes Source #
encodeNat64be :: Word64 -> Bytes Source #
encodeNat16le :: Word64 -> Bytes Source #
encodeNat32le :: Word64 -> Bytes Source #
encodeNat64le :: Word64 -> Bytes Source #
decodeUtf8 :: ByteString -> Text #
Decode a ByteString
containing UTF-8 encoded text that is known
to be valid.
If the input contains any invalid UTF-8 data, an exception will be
thrown that cannot be caught in pure code. For more control over
the handling of invalid data, use decodeUtf8'
or
decodeUtf8With
.
This is a partial function: it checks that input is a well-formed UTF-8 sequence and copies buffer or throws an error otherwise.
encodeUtf8 :: Text -> ByteString #
Encode text using UTF-8 encoding.
zlibCompress :: Bytes -> Bytes Source #
zlibDecompress :: Bytes -> Bytes Source #
gzipCompress :: Bytes -> Bytes Source #
gzipDecompress :: Bytes -> Bytes Source #