Scala: generic lists