Always returns this
, so that this
can be passed to Splitter#through
Always returns this
, so that this
can be passed to Splitter#through
An intermediate object with an apply
and flatMap
that both create a sequenced Parser
which combines this Parser with a function to create the next one.
An intermediate object with an apply
and flatMap
that both create a sequenced Parser
which combines this Parser with a function to create the next one.
Examples:
val p1: Parser[A] = /* ... */ def getP2(p1Result: A): Parser[B] = /* ... */ val combined: Parser[B] = p1.followedBy(getP2) // alternative `flatMap` syntax val combined: Parser[B] = for { p1Result <- p1.followedBy p2Result <- getP2(p1Result) } yield p2Result
An example of where this is useful is when a parser for XML element depends on values parsed from one of its previous siblings, but where you don't want to wait until the end of their parent element before they can be combined.
An intermediate object which has an apply
and flatMap
that can be used
to combine this Parser and another in a sequence.
An intermediate object that can be used to create a Transformer from result of this Parser.
An intermediate object that can be used to create a Transformer from result of this Parser.
Examples:
val p1: Parser[A] = /* ... */ def getP2Stream(p1Result: A): Transformer[XMLEvent, B] = /* ... */ val combined: Transformer[XMLEvent, B] = p1.andThenStream(getP2Stream) // alternative `flatMap` syntax val combined: Transformer[XMLEvent, B] = for { p1Result <- p1.andThenStream p2Result <- getP2Stream(p1Result) } yield p2Result
An example of where this is useful is when an XML element contains some "dictionary" object
at the beginning, followed by a sequence of "data" objects which reference the dictionary.
For large sequences, combining them to a List (to use with Parser's and
combiners) is undesireable;
we can use this approach to avoid doing so.
An intermediate object which has an apply
and flatMap
that can be used
to combine this Parser and a Transformer in a sequence.
Create a new handler factory whose results are transformed by the given function f
.
Create a new handler factory whose results are transformed by the given function f
.
The mapped result type
The function to apply to each result
A new handler factory which derives its results by applying f
to the results generated by this handler factory
syntax.FunctorSyntax.NestedFunctorOps#mapF for when Out
is a container e.g. Option or List
Create a new parser whose result containers are transformed by the given function f
.
Create a new parser whose result containers are transformed by the given function f
.
For Consumers, which use Id
as the result container type, mapResult
is equivalent to map
.
The mapped result type
The function applied to each result container
a new Parser
which derives its results by applying f
to the result containers generated by this parser
If a Parser
is context-independent, it can be treated to a Consumer
.
If a Parser
is context-independent, it can be treated to a Consumer
.
A representation of this parser as a Consumer
A HandlerFactory specialized for XMLEvents, which produces results wrapped in a
Try
. Parsers can be combined and run to process complex XML structures.Result type