zipped
parsley.syntax.zipped
object zipped
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
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
zipped.type
Members list
Implicits
Inherited implicits
Attributes
- Inherited from:
- zipped (hidden)
- Source
- zipped.scala
Attributes
- Inherited from:
- zipped (hidden)
- Source
- zipped.scala
implicit def zippedSyntax12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12](t: (Parsley[T1], Parsley[T2], Parsley[T3], Parsley[T4], Parsley[T5], Parsley[T6], Parsley[T7], Parsley[T8], Parsley[T9], Parsley[T10], Parsley[T11], Parsley[T12])): Zipped12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12]
Attributes
- Inherited from:
- zipped (hidden)
- Source
- zipped.scala
implicit def zippedSyntax13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13](t: (Parsley[T1], Parsley[T2], Parsley[T3], Parsley[T4], Parsley[T5], Parsley[T6], Parsley[T7], Parsley[T8], Parsley[T9], Parsley[T10], Parsley[T11], Parsley[T12], Parsley[T13])): Zipped13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13]
Attributes
- Inherited from:
- zipped (hidden)
- Source
- zipped.scala
implicit def zippedSyntax14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14](t: (Parsley[T1], Parsley[T2], Parsley[T3], Parsley[T4], Parsley[T5], Parsley[T6], Parsley[T7], Parsley[T8], Parsley[T9], Parsley[T10], Parsley[T11], Parsley[T12], Parsley[T13], Parsley[T14])): Zipped14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14]
Attributes
- Inherited from:
- zipped (hidden)
- Source
- zipped.scala
implicit def zippedSyntax15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15](t: (Parsley[T1], Parsley[T2], Parsley[T3], Parsley[T4], Parsley[T5], Parsley[T6], Parsley[T7], Parsley[T8], Parsley[T9], Parsley[T10], Parsley[T11], Parsley[T12], Parsley[T13], Parsley[T14], Parsley[T15])): Zipped15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15]
Attributes
- Inherited from:
- zipped (hidden)
- Source
- zipped.scala
implicit def zippedSyntax16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16](t: (Parsley[T1], Parsley[T2], Parsley[T3], Parsley[T4], Parsley[T5], Parsley[T6], Parsley[T7], Parsley[T8], Parsley[T9], Parsley[T10], Parsley[T11], Parsley[T12], Parsley[T13], Parsley[T14], Parsley[T15], Parsley[T16])): Zipped16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16]
Attributes
- Inherited from:
- zipped (hidden)
- Source
- zipped.scala
implicit def zippedSyntax17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17](t: (Parsley[T1], Parsley[T2], Parsley[T3], Parsley[T4], Parsley[T5], Parsley[T6], Parsley[T7], Parsley[T8], Parsley[T9], Parsley[T10], Parsley[T11], Parsley[T12], Parsley[T13], Parsley[T14], Parsley[T15], Parsley[T16], Parsley[T17])): Zipped17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17]
Attributes
- Inherited from:
- zipped (hidden)
- Source
- zipped.scala
implicit def zippedSyntax18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18](t: (Parsley[T1], Parsley[T2], Parsley[T3], Parsley[T4], Parsley[T5], Parsley[T6], Parsley[T7], Parsley[T8], Parsley[T9], Parsley[T10], Parsley[T11], Parsley[T12], Parsley[T13], Parsley[T14], Parsley[T15], Parsley[T16], Parsley[T17], Parsley[T18])): Zipped18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18]
Attributes
- Inherited from:
- zipped (hidden)
- Source
- zipped.scala
implicit def zippedSyntax19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19](t: (Parsley[T1], Parsley[T2], Parsley[T3], Parsley[T4], Parsley[T5], Parsley[T6], Parsley[T7], Parsley[T8], Parsley[T9], Parsley[T10], Parsley[T11], Parsley[T12], Parsley[T13], Parsley[T14], Parsley[T15], Parsley[T16], Parsley[T17], Parsley[T18], Parsley[T19])): Zipped19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19]
Attributes
- Inherited from:
- zipped (hidden)
- Source
- zipped.scala
Attributes
- Inherited from:
- zipped (hidden)
- Source
- zipped.scala
implicit def zippedSyntax20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20](t: (Parsley[T1], Parsley[T2], Parsley[T3], Parsley[T4], Parsley[T5], Parsley[T6], Parsley[T7], Parsley[T8], Parsley[T9], Parsley[T10], Parsley[T11], Parsley[T12], Parsley[T13], Parsley[T14], Parsley[T15], Parsley[T16], Parsley[T17], Parsley[T18], Parsley[T19], Parsley[T20])): Zipped20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20]
Attributes
- Inherited from:
- zipped (hidden)
- Source
- zipped.scala
implicit def zippedSyntax21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21](t: (Parsley[T1], Parsley[T2], Parsley[T3], Parsley[T4], Parsley[T5], Parsley[T6], Parsley[T7], Parsley[T8], Parsley[T9], Parsley[T10], Parsley[T11], Parsley[T12], Parsley[T13], Parsley[T14], Parsley[T15], Parsley[T16], Parsley[T17], Parsley[T18], Parsley[T19], Parsley[T20], Parsley[T21])): Zipped21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21]
Attributes
- Inherited from:
- zipped (hidden)
- Source
- zipped.scala
implicit def zippedSyntax22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22](t: (Parsley[T1], Parsley[T2], Parsley[T3], Parsley[T4], Parsley[T5], Parsley[T6], Parsley[T7], Parsley[T8], Parsley[T9], Parsley[T10], Parsley[T11], Parsley[T12], Parsley[T13], Parsley[T14], Parsley[T15], Parsley[T16], Parsley[T17], Parsley[T18], Parsley[T19], Parsley[T20], Parsley[T21], Parsley[T22])): Zipped22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22]
Attributes
- Inherited from:
- zipped (hidden)
- Source
- zipped.scala
Attributes
- Inherited from:
- zipped (hidden)
- Source
- zipped.scala
Attributes
- Inherited from:
- zipped (hidden)
- Source
- zipped.scala
Attributes
- Inherited from:
- zipped (hidden)
- Source
- zipped.scala
Attributes
- Inherited from:
- zipped (hidden)
- Source
- zipped.scala
Attributes
- Inherited from:
- zipped (hidden)
- Source
- zipped.scala
Attributes
- Inherited from:
- zipped (hidden)
- Source
- zipped.scala
In this article