title: Scala case classes and lists
body: <p>I'm completely new to Scala. Right now I'm attempting port a parser I wrote in Standard ML to Scala and having an issue with the following code:</p>
  
  <pre><code>abstract class Token
  case class Zero extends Token
  case class At extends Token
  //...
  
  object Tokenizer {
    def tokenize(seq : List[Char]) : List[Token] = seq match {
      case List() =&gt; error("Empty input")
      case '0' :: rest =&gt; Zero :: tokenize(rest)
      case '@' :: rest =&gt; At :: tokenize(rest)
      //...
    }  
  }
  </code></pre>
  
  <p>In SML I wouldn't have to declare the return type of the tokenize() method but it seems Scala needs it and it is somehow not happy with the type I have provided (it complains Zero, At are invalid types and that they should be of type Token instead). Note that I also want to patten match the token list at a later point in time during the parsing phase.</p>
  
  <p>I did some searching on the web and on stackoverflow itself to see if a similar question has been raised before (it looked so trivial) but somehow I couldn't find anything. I'm pretty sure I've got something basic wrong, please feel free to enlighten me :)</p>