network-anonymous-i2p-0.10.0: Haskell API for I2P anonymous networking

Safe HaskellNone
LanguageHaskell2010

Network.Anonymous.I2P.Protocol.Parser.Ast

Description

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.

Synopsis

Documentation

data Token Source

A token is a key and can maybe have an associated value

Instances

type Line = [Token] Source

A line is just a sequence of tokens -- the Parser ends the chain when a newline is received.

key Source

Arguments

:: ByteString

The key to look for

-> [Token]

Tokens to consider

-> Bool

Result

Returns true if the key was found

value Source

Arguments

:: 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

valueAs :: Parser a -> ByteString -> [Token] -> Maybe a Source

Retrieves value, and applies it to an Attoparsec parser