Safe Haskell | None |
---|---|
Language | Haskell2010 |
Parsing and serialization for directories and their entries.
Synopsis
- parse :: ByteString -> Either (ParseErrorBundle ByteString Void) Directory
- type Parser = Parsec Void ByteString
- natural :: Integral i => Parser i
- pNetstring :: (Int -> Parser a) -> Parser a
- pDirectory :: Parser Directory
- pEntry :: Parser Entry
- pUTF8 :: Int -> Parser Text
- serialize :: Directory -> ByteString
- serializeEntry :: Entry -> ByteString
- netstring :: ByteString -> ByteString
Documentation
parse :: ByteString -> Either (ParseErrorBundle ByteString Void) Directory Source #
Parse the serialized form of a directory into a Directory.
type Parser = Parsec Void ByteString Source #
The parser type we will parse in.
:: (Int -> Parser a) | A function that takes the length of the string encoded in the netstring and returns a parser for the value the encoded string represents. |
-> Parser a | A parser for the value. |
Parse a netstring-encoded value, applying a sub-parser to the encoded string.
serialize :: Directory -> ByteString Source #
Serialize a Directory to the canonical bytes representation.
serializeEntry :: Entry -> ByteString Source #
netstring :: ByteString -> ByteString Source #
Encode a bytestring as a netstring.