parsley.syntax
Members list
Type members
Classlikes
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
- Source
- extension.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
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
- Source
- extension.scala
- Supertypes
-
class Objecttrait Matchableclass Any
This class implements the lift
syntax on any value, which functions as pure
as a postfix method.
This class implements the lift
syntax on any value, which functions as pure
as a postfix method.
Value parameters
- x
-
the value to lift to the parser level.
Attributes
- Source
- lift.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the lift
syntax on functions of arity one: a flipped map
.
This class enables the lift
syntax on functions of arity one: a flipped map
.
Value parameters
- f
-
the function to apply to the result of the parser.
Attributes
- Source
- lift.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the lift
syntax on functions of arity ten.
This class enables the lift
syntax on functions of arity ten.
Value parameters
- f
-
the function to apply to the parsers.
Attributes
- Source
- lift.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the lift
syntax on functions of arity eleven.
This class enables the lift
syntax on functions of arity eleven.
Value parameters
- f
-
the function to apply to the parsers.
Attributes
- Source
- lift.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the lift
syntax on functions of arity twelve.
This class enables the lift
syntax on functions of arity twelve.
Value parameters
- f
-
the function to apply to the parsers.
Attributes
- Source
- lift.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the lift
syntax on functions of arity thirteen.
This class enables the lift
syntax on functions of arity thirteen.
Value parameters
- f
-
the function to apply to the parsers.
Attributes
- Source
- lift.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the lift
syntax on functions of arity fourteen.
This class enables the lift
syntax on functions of arity fourteen.
Value parameters
- f
-
the function to apply to the parsers.
Attributes
- Source
- lift.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the lift
syntax on functions of arity fifteen.
This class enables the lift
syntax on functions of arity fifteen.
Value parameters
- f
-
the function to apply to the parsers.
Attributes
- Source
- lift.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the lift
syntax on functions of arity sixteen.
This class enables the lift
syntax on functions of arity sixteen.
Value parameters
- f
-
the function to apply to the parsers.
Attributes
- Source
- lift.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the lift
syntax on functions of arity seventeen.
This class enables the lift
syntax on functions of arity seventeen.
Value parameters
- f
-
the function to apply to the parsers.
Attributes
- Source
- lift.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the lift
syntax on functions of arity eighteen.
This class enables the lift
syntax on functions of arity eighteen.
Value parameters
- f
-
the function to apply to the parsers.
Attributes
- Source
- lift.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the lift
syntax on functions of arity nineteen.
This class enables the lift
syntax on functions of arity nineteen.
Value parameters
- f
-
the function to apply to the parsers.
Attributes
- Source
- lift.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the lift
syntax on functions of arity two.
This class enables the lift
syntax on functions of arity two.
Value parameters
- f
-
the function to apply to the parsers.
Attributes
- Source
- lift.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the lift
syntax on functions of arity twenty.
This class enables the lift
syntax on functions of arity twenty.
Value parameters
- f
-
the function to apply to the parsers.
Attributes
- Source
- lift.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the lift
syntax on functions of arity twenty-one.
This class enables the lift
syntax on functions of arity twenty-one.
Value parameters
- f
-
the function to apply to the parsers.
Attributes
- Source
- lift.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the lift
syntax on functions of arity twenty-two.
This class enables the lift
syntax on functions of arity twenty-two.
Value parameters
- f
-
the function to apply to the parsers.
Attributes
- Source
- lift.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the lift
syntax on functions of arity three.
This class enables the lift
syntax on functions of arity three.
Value parameters
- f
-
the function to apply to the parsers.
Attributes
- Source
- lift.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the lift
syntax on functions of arity four.
This class enables the lift
syntax on functions of arity four.
Value parameters
- f
-
the function to apply to the parsers.
Attributes
- Source
- lift.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the lift
syntax on functions of arity five.
This class enables the lift
syntax on functions of arity five.
Value parameters
- f
-
the function to apply to the parsers.
Attributes
- Source
- lift.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the lift
syntax on functions of arity six.
This class enables the lift
syntax on functions of arity six.
Value parameters
- f
-
the function to apply to the parsers.
Attributes
- Source
- lift.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the lift
syntax on functions of arity seven.
This class enables the lift
syntax on functions of arity seven.
Value parameters
- f
-
the function to apply to the parsers.
Attributes
- Source
- lift.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the lift
syntax on functions of arity eight.
This class enables the lift
syntax on functions of arity eight.
Value parameters
- f
-
the function to apply to the parsers.
Attributes
- Source
- lift.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the lift
syntax on functions of arity nine.
This class enables the lift
syntax on functions of arity nine.
Value parameters
- f
-
the function to apply to the parsers.
Attributes
- Source
- lift.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
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
- Since
-
4.0.0
- Source
- extension.scala
- Supertypes
-
class Objecttrait Matchableclass Any
This class enables the zipped
syntax on tuples of ten parsers.
This class enables the zipped
syntax on tuples of ten parsers.
Value parameters
- t
-
the ten parsers whose results should be zipped together.
Attributes
- Source
- zipped.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the zipped
syntax on tuples of eleven parsers.
This class enables the zipped
syntax on tuples of eleven parsers.
Value parameters
- t
-
the eleven parsers whose results should be zipped together.
Attributes
- Source
- zipped.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the zipped
syntax on tuples of twelve parsers.
This class enables the zipped
syntax on tuples of twelve parsers.
Value parameters
- t
-
the twelve parsers whose results should be zipped together.
Attributes
- Source
- zipped.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the zipped
syntax on tuples of thirteen parsers.
This class enables the zipped
syntax on tuples of thirteen parsers.
Value parameters
- t
-
the thirteen parsers whose results should be zipped together.
Attributes
- Source
- zipped.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the zipped
syntax on tuples of fourteen parsers.
This class enables the zipped
syntax on tuples of fourteen parsers.
Value parameters
- t
-
the fourteen parsers whose results should be zipped together.
Attributes
- Source
- zipped.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the zipped
syntax on tuples of fifteen parsers.
This class enables the zipped
syntax on tuples of fifteen parsers.
Value parameters
- t
-
the fifteen parsers whose results should be zipped together.
Attributes
- Source
- zipped.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the zipped
syntax on tuples of sixteen parsers.
This class enables the zipped
syntax on tuples of sixteen parsers.
Value parameters
- t
-
the sixteen parsers whose results should be zipped together.
Attributes
- Source
- zipped.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the zipped
syntax on tuples of seventeen parsers.
This class enables the zipped
syntax on tuples of seventeen parsers.
Value parameters
- t
-
the seventeen parsers whose results should be zipped together.
Attributes
- Source
- zipped.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the zipped
syntax on tuples of eighteen parsers.
This class enables the zipped
syntax on tuples of eighteen parsers.
Value parameters
- t
-
the eighteen parsers whose results should be zipped together.
Attributes
- Source
- zipped.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the zipped
syntax on tuples of nineteen parsers.
This class enables the zipped
syntax on tuples of nineteen parsers.
Value parameters
- t
-
the nineteen parsers whose results should be zipped together.
Attributes
- Source
- zipped.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the zipped
syntax on pairs of two parsers.
This class enables the zipped
syntax on pairs of two parsers.
Value parameters
- t
-
the two parsers whose results should be zipped together.
Attributes
- Source
- zipped.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the zipped
syntax on tuples of twenty parsers.
This class enables the zipped
syntax on tuples of twenty parsers.
Value parameters
- t
-
the twenty parsers whose results should be zipped together.
Attributes
- Source
- zipped.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the zipped
syntax on tuples of twenty-one parsers.
This class enables the zipped
syntax on tuples of twenty-one parsers.
Value parameters
- t
-
the twenty-one parsers whose results should be zipped together.
Attributes
- Source
- zipped.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the zipped
syntax on tuples of twenty-two parsers.
This class enables the zipped
syntax on tuples of twenty-two parsers.
Value parameters
- t
-
the twenty-two parsers whose results should be zipped together.
Attributes
- Source
- zipped.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the zipped
syntax on tuples of three parsers.
This class enables the zipped
syntax on tuples of three parsers.
Value parameters
- t
-
the three parsers whose results should be zipped together.
Attributes
- Source
- zipped.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the zipped
syntax on tuples of four parsers.
This class enables the zipped
syntax on tuples of four parsers.
Value parameters
- t
-
the four parsers whose results should be zipped together.
Attributes
- Source
- zipped.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the zipped
syntax on tuples of five parsers.
This class enables the zipped
syntax on tuples of five parsers.
Value parameters
- t
-
the five parsers whose results should be zipped together.
Attributes
- Source
- zipped.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the zipped
syntax on tuples of six parsers.
This class enables the zipped
syntax on tuples of six parsers.
Value parameters
- t
-
the six parsers whose results should be zipped together.
Attributes
- Source
- zipped.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the zipped
syntax on tuples of seven parsers.
This class enables the zipped
syntax on tuples of seven parsers.
Value parameters
- t
-
the seven parsers whose results should be zipped together.
Attributes
- Source
- zipped.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the zipped
syntax on tuples of eight parsers.
This class enables the zipped
syntax on tuples of eight parsers.
Value parameters
- t
-
the eight parsers whose results should be zipped together.
Attributes
- Source
- zipped.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
This class enables the zipped
syntax on tuples of nine parsers.
This class enables the zipped
syntax on tuples of nine parsers.
Value parameters
- t
-
the nine parsers whose results should be zipped together.
Attributes
- Source
- zipped.scala
- Supertypes
-
class AnyValtrait Matchableclass Any
Provides implicit conversions for characters and strings into parsers.
Provides implicit conversions for characters and strings into parsers.
The use of char
and string
can be distracting to the overall structure of the parser with respect to the grammar. This module exposes combinators that can implicitly convert Scala's string and character literals so that they represent parsers. These will not be whitespace sensitive.
Attributes
- Since
-
4.5.0
- Source
- character.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
character.type
These implicit classes can be used to extend the core combinator set of Parsley.
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
- Since
-
4.5.0
- Source
- extension.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
extension.type
This module provides the "lift
syntax", which enables a lift
combinator on functions of arities up to 22, applying the function across the results of several parsers.
This module provides the "lift
syntax", which enables a lift
combinator on functions of arities up to 22, applying the function across the results of several parsers.
Attributes
- Since
-
4.5.0
- Note
-
a limitation of this syntax is that it requires the function's type to be fully known. For a version of this syntax that behaves better with type inference, see
zipped
. - Example
-
scala> import parsley.character.char scala> import parsley.syntax.lift.{liftSyntax2, liftSyntax3} scala> case class Add(x: Int, y: Int) scala> val p = Add.lift(char('a').as(4), char('b').as(5)) scala> p.parse("ab") val res0 = Success(Add(4, 5)) scala> val f = (x: Int, y: Int, z: Int) => x * y + z scala> val q = f.lift(char('a').as(3), char('b').as(2), char('c').as(5)) scala> q.parse("abc") val res1 = Success(11) scala> q.parse("ab") val res2 = Failure(..)
- Source
- lift.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
lift.type
This module provides alternatives to the f.lift(x, y)
syntax, (x, y).zipped(f)
, which works better with type inference.
This module provides alternatives to the f.lift(x, y)
syntax, (x, y).zipped(f)
, which works better with type inference.
Also enables a parameterless zipped
method, to pair an arbitrary number of parsers such that (p, q).zipped = p.zip(q)
.
Thanks to Andrei Gramescu and George Stacey for ensuring that these combinators even exist in the first place.
Attributes
- Since
-
4.5.0
- Note
-
these methods are not lazy like the
lift
syntax orliftN
functions! Use the prefix~
combinator to make arguments lazy where necessary. - Example
-
scala> import parsley.character.char scala> import parsley.syntax.zipped._ scala> case class Add(x: Int, y: Int) scala> val p = (char('a').as(4), char('b').as(5)).zipped(Add) scala> p.parse("ab") val res0 = Success(Add(4, 5)) scala> val q = (char('a').as(3), char('b').as(2), char('c').as(5)).zipped((x, y, z) => x * y + z) scala> q.parse("abc") val res1 = Success(11) scala> q.parse("ab") val res2 = Failure(..)
- Source
- zipped.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
zipped.type