title: Implementing class for pattern matching
body: <p>For example,</p>
  
  <pre><code>val list = List(1,2,3)
  list match {
    case a :: b =&gt; 
    case _      =&gt; 
  }
  </code></pre>
  
  <p>you can match head and tail of a List using <code>::</code> or tokens of ParseResult using <code>~</code>. What should I do to create class that can be matched like preceding classes?</p>
  
  <p>UPD: </p>
  
  <p>And have possibility to write:</p>
  
  <pre><code>case class @ ...
  List(1,2,3,4) match {
    case 1 @ 2 @ 3 @ 4 =&gt; 
  }
  </code></pre>