Safe Haskell | None |
---|---|
Language | Haskell2010 |
Abstract syntax tree used by the Parser
, including helper functions
for traversing the tree.
Warning: This function is used internally by I2P
and using these functions directly is unsupported. The
interface of these functions might change at any time without
prior notice.
- data Token = Token ByteString (Maybe ByteString)
- type Line = [Token]
- key :: ByteString -> [Token] -> Bool
- value :: ByteString -> [Token] -> Maybe ByteString
- valueAs :: Parser a -> ByteString -> [Token] -> Maybe a
Documentation
A token is a key and can maybe have an associated value
A line is just a sequence of tokens -- the Parser
ends the chain
when a newline is received.
:: ByteString | The key to look for |
-> [Token] | Tokens to consider |
-> Bool | Result |
Returns true if the key was found
:: ByteString | Key to look for |
-> [Token] | Tokens to consider |
-> Maybe ByteString | The value if the key was found |
Looks up a key and returns the value if found