abnf-0.3.1.0: Parse ABNF and generate parsers for the specified document

Copyright(c) Martin Zeller, 2016
LicenseBSD2
MaintainerMartin Zeller <mz.bremerhaven@gmail.com>
Stabilityexperimental
PortabilityScopedTypeVariables
Safe HaskellSafe
LanguageHaskell2010

Text.ABNF.Document.Operations

Description

 

Synopsis

Documentation

filterDocument Source

Arguments

:: (Document a -> Bool)

Predicate to check

-> Document a

Document to filter

-> Maybe (Document a)

Returns Nothing if the predicate fails, cascades otherwise

Filter documents according to some predicate. Similar to filter in the Prelude.

squashDocument :: Monoid a => Document a -> Document a Source

Squash all contents of a Document into a single Terminal

squashDocumentOn :: forall a. Monoid a => (Document a -> Bool) -> Document a -> Document a Source

Squash all contents of a Document which matches the predicate See also squashDocument

squashContent :: Monoid a => [Content a] -> a Source

Squash all contents using the Monoid instance of a, cascading into NonTerminals.

lookupDocument Source

Arguments

:: Text

Identifier to search for

-> Document a

Document to search in

-> [Document a] 

Looks up nested Documents with a particular identifier. NB: Will not recurse into matching documents.