abnf-0.4.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

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.

lookupDocument' Source #

Arguments

:: Text

Identifier to search for

-> Document a

Document to search in

-> [Document a] 

Similar to lookupDocument, lookupDocument' will find a Document with a particular identifier. This, however, will only find immediate children and will not recurse.