pattern-matching non-List sequences in Scala