| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.ByteString.Optics
Synopsis
- class IsByteString t where
- packedBytes :: Iso' [Word8] t
- packedChars :: Iso' String t
- bytes :: IxTraversal' Int64 t Word8
- chars :: IxTraversal' Int64 t Char
- unpackedBytes :: IsByteString t => Iso' t [Word8]
- unpackedChars :: IsByteString t => Iso' t String
- pattern Bytes :: IsByteString t => [Word8] -> t
- pattern Chars :: IsByteString t => [Char] -> t
Documentation
class IsByteString t where Source #
Traversals for ByteStrings.
Methods
packedBytes :: Iso' [Word8] t Source #
pack (or unpack) a list of bytes into
a strict or lazy ByteString.
packx ≡ x^.packedBytesunpackx ≡ x^.repackedBytespackedBytes≡reunpackedBytes
packedChars :: Iso' String t Source #
pack (or unpack) a list
of characters into a strict or lazy ByteString.
When writing back to the ByteString it is assumed that every Char lies
between 'x00' and 'xff'.
packx ≡ x^.packedCharsunpackx ≡ x^.repackedCharspackedChars≡reunpackedChars
bytes :: IxTraversal' Int64 t Word8 Source #
Traverse each Word8 in a strict or lazy ByteString
This Traversal walks each strict ByteString chunk in a tree-like
fashion enable zippers to seek to locations more quickly and accelerate
many monoidal queries, but up to associativity (and constant factors) it is
equivalent to the much slower:
bytes≡unpackedBytes.traversed
anyOfbytes(==0x80) ::ByteString->Bool
chars :: IxTraversal' Int64 t Char Source #
Traverse the individual bytes in a strict or lazy ByteString as
characters.
When writing back to the ByteString it is assumed that every Char lies
between 'x00' and 'xff'.
This Traversal walks each strict ByteString chunk in a tree-like
fashion enable zippers to seek to locations more quickly and accelerate
many monoidal queries, but up to associativity (and constant factors) it is
equivalent to the much slower:
chars≡unpackedChars.traversed
anyOfchars(=='c') ::ByteString->Bool
Instances
| IsByteString ByteString Source # | |
Defined in Data.ByteString.Optics Methods packedBytes :: Iso' [Word8] ByteString Source # packedChars :: Iso' String ByteString Source # | |
| IsByteString ByteString Source # | |
Defined in Data.ByteString.Optics Methods packedBytes :: Iso' [Word8] ByteString Source # packedChars :: Iso' String ByteString Source # | |
unpackedBytes :: IsByteString t => Iso' t [Word8] Source #
unpack (or pack) a ByteString into a
list of bytes.
unpackedBytes≡repackedBytesunpackx ≡ x^.unpackedBytespackx ≡ x^.reunpackedBytes
unpackedBytes::Iso'ByteString[Word8]unpackedBytes::Iso'ByteString[Word8]
unpackedChars :: IsByteString t => Iso' t String Source #
unpack (or pack) a list of
characters into a strict (or lazy) ByteString
When writing back to the ByteString it is assumed that every Char lies
between 'x00' and 'xff'.
unpackedChars≡repackedCharsunpackx ≡ x^.unpackedCharspackx ≡ x^.reunpackedChars
unpackedChars::Iso'ByteStringStringunpackedChars::Iso'ByteStringString
pattern Bytes :: IsByteString t => [Word8] -> t Source #
pattern Chars :: IsByteString t => [Char] -> t Source #