LazyChooseParsley

parsley.extension$.LazyChooseParsley
final implicit class LazyChooseParsley[P, Q, +A](pq: => (P, Q))(implicit conP: P => Parsley[A], conQ: Q => Parsley[A])

This class exposes an if combinator on pairs of parsers.

This extension class operators on pairs of values that are convertible to parsers. It enables the use of the ?: combinator, which is an alias for ifP.

Type parameters

P

the type of left base value that this class is used on (the conversion to Parsley) is summoned automatically.

Q

the type of right base value that this class is used on (the conversion to Parsley) is summoned automatically.

Value parameters

conP

a conversion that allows values convertible to parsers to be used.

conQ

a conversion that allows values convertible to parsers to be used.

pq

The values (convertible to parsers) that serve the branches of the if.

Attributes

Constructor

This constructor should not be called manually, it is designed to be used via Scala's implicit resolution.

Version

4.0.0

Source
extension.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def ?:(b: Parsley[Boolean]): Parsley[A]

This combinator will conditionally parse one of the parsers in this pair depending on the result of a third parser b.

This combinator will conditionally parse one of the parsers in this pair depending on the result of a third parser b.

Equivalent to ifP, but in operator form: ifP(b, p, q) is the same as b ?: (p, q).

Attributes

See also

ifP

Note

Scala applies methods ending in : right-associatively, and the pair is on the right-hand side of the operator.

Source
extension.scala