For example,
val list = List(1,2,3)
list match {
case a :: b =>
case _ =>
}
you can match head and tail of a List using ::
or tokens of ParseResult using ~
. What should I do to create class that can be matched like preceding classes?
UPD:
And have possibility to write:
case class @ ...
List(1,2,3,4) match {
case 1 @ 2 @ 3 @ 4 =>
}