~

scala.util.parsing.combinator.Parsers.~
case class ~[+a, +b](_1: a, _2: b)

A wrapper over sequence of matches.

Given p1: Parser[A] and p2: Parser[B], a parser composed with p1 ~ p2 will have type Parser[~[A, B]]. The successful result of the parser can be extracted from this case class.

It also enables pattern matching, so something like this is possible:

def concat(p1: Parser[String], p2: Parser[String]): Parser[String] =
  p1 ~ p2 ^^ { case a ~ b => a + b }

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns:

a string representation of the object.

Definition Classes
Any

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product