FollowedBy

trait FollowedBy[In, +A, M[_, _]]

An intermediate object for creating sequence-based combination methods for a Parser or Consumer.

Type parameters:
A

Output type for the "first" parser/consumer; using the combination methods in this trait will result in an instance of T1 being used to create a "second" parser/consumer/transformer to be run sequentially after the first.

M

Type constructor for the parser/consumer of a given output type

class Object
trait Matchable
class Any
FollowedBy[In, A, M]

Value members

Abstract methods

def apply[Out](followUp: A => M[In, Out])(implicit S: StackLike[In, Any]): M[In, Out]

Creates a sequence handler by combining this one and a getNext function such that when this handler finishes, a second handler is created by passing its result ot getNext.

Creates a sequence handler by combining this one and a getNext function such that when this handler finishes, a second handler is created by passing its result ot getNext.

Value parameters:
followUp

A function that creates the new Parser/Transformer (whichever M is in this context) based on the result of this parser

Returns:

The combined parser/transformer

Concrete methods

def flatMap[Out](followUp: A => M[In, Out])(implicit S: StackLike[In, Any]): M[In, Out]

Alias for apply, allowing the use of for-comprehension syntax, e.g.

Alias for apply, allowing the use of for-comprehension syntax, e.g.

for {
 a <- someParser
 result <- getNextParser(a)
} yield result
def map[B](f: A => B)(implicit S: StackLike[In, Any]): FollowedBy[In, B, M]

Transforms the intermediate result that will be passed to the followUp function. Really this method is only here to allow for-comprehension syntax to be used - see flatMap. You probably don't want to call this explicitly.

Transforms the intermediate result that will be passed to the followUp function. Really this method is only here to allow for-comprehension syntax to be used - see flatMap. You probably don't want to call this explicitly.