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 consumer
which combines this consumer with a function to create the next one.
An intermediate object with an apply
and flatMap
that both create a sequenced consumer
which combines this consumer with a function to create the next one.
Examples:
val c1: Consumer[In, A] = /* ... */ def getC2(c1Result: A): Consumer[In, B] = /* ... */ val combined: Consumer[In, B] = c1.followedBy(getC2) // alternative `flatMap` syntax val combined: Consumer[In, B] = for { c1Result <- c1.followedBy c2Result <- getC2(c1Result) } yield c2Result
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 Consumer and another in a sequence.
An intermediate object with an apply
and flatMap
that can be used to create a Transformer from result of this consumer.
An intermediate object with an apply
and flatMap
that can be used to create a Transformer from result of this consumer.
Examples:
val c1: Consumer[In, A] = /* ... */ def getStream(c1Result: A): Transformer[In, B] = /* ... */ val combined: Transformer[In, B] = c1.followedByStream(getStream) // alternative `flatMap` syntax val combined: Transformer[In, B] = for { c1Result <- c1.followedByStream c2Result <- getStream(c1Result) } yield c2Result
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 consumer 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 handler factory whose result containers are transformed by the given function f
.
Create a new handler factory 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 function applied to each result container
a new HandlerFactory which derives its results by applying f
to the result containers generated by this handler factory