, . List sealed abstract class , Nil :: (, ). - sealed. , , List, , List.
sealed , List, , , , .
, , , :: . , case:
case class Foo(a: String, b: Int)
x match {
case Foo(a, b) =>
}
, case , :
x match {
case a Foo b =>
}
, :
list match {
case ::(head, tail) => {
, , , ::. , , , Nil .
share