extension

parsley.extension$
object extension

These implicit classes can be used to extend the core combinator set of Parsley.

This may mean that importing them enables combinators that can be used on non-Parsley types, or might enable some syntactic sugar that is not part of the core combinator "style".

Attributes

Source:
extension.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Type members

Classlikes

final implicit class HaskellStyleMap[-A, +B](val f: A => B) extends AnyVal

This class exposes the <#> combinator on functions.

This class exposes the <#> combinator on functions.

This extension class operates on functions. It enables the use of the <#> combinator, which is an alias for map designed to more closely mimic Haskell's style.

Attributes

f

the function that is used for the map.

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 AnyVal
trait Matchable
class Any
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 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.

Attributes

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.

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.

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
final implicit class OperatorSugar[P, +A](p: P)(implicit con: P => Parsley[A])

This class enables "operator-style" alternative combinators on parsers.

This class enables "operator-style" alternative combinators on parsers.

This extension class exposes a collection of "operator-style" combinators on values that are convertible to parsers that are plain syntactic sugar for other functionality in the library; they are potentially less readable than the combinators they replace, so should be used sparingly.

Attributes

P

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

con

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

p

the value that this class is enabling methods on.

Constructor:

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

Since:

4.0.0

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

Implicits

Implicits

final implicit def HaskellStyleMap[A, B](f: A => B): HaskellStyleMap[A, B]

This class exposes the <#> combinator on functions.

This class exposes the <#> combinator on functions.

This extension class operates on functions. It enables the use of the <#> combinator, which is an alias for map designed to more closely mimic Haskell's style.

Attributes

f

the function that is used for the map.

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
final implicit def LazyChooseParsley[P, Q, A](pq: => (P, Q))(implicit conP: P => Parsley[A], conQ: Q => Parsley[A]): LazyChooseParsley[P, Q, A]

This class exposes an if combinator on pairs of parsers.

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.

Attributes

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.

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.

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
final implicit def OperatorSugar[P, A](p: P)(implicit con: P => Parsley[A]): OperatorSugar[P, A]

This class enables "operator-style" alternative combinators on parsers.

This class enables "operator-style" alternative combinators on parsers.

This extension class exposes a collection of "operator-style" combinators on values that are convertible to parsers that are plain syntactic sugar for other functionality in the library; they are potentially less readable than the combinators they replace, so should be used sparingly.

Attributes

P

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

con

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

p

the value that this class is enabling methods on.

Constructor:

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

Since:

4.0.0

Source:
extension.scala