Slide 30
Slide 30 text
to[Collection]
scala> List(2, 1, 3).to[Seq]
res17: Seq[Int] = Vector(2, 1, 3)
scala> List(2, 1, 3).to[Vector]
res18: Vector[Int] = Vector(2, 1, 3)
scala> List(2, 1, 3).to[collection.mutable.Seq]
res19: scala.collection.mutable.Seq[Int] = ArrayBuffer(2,
1, 3)
scala> List(2, 1, 3).to[collection.immutable.SortedSet]
res20: scala.collection.immutable.SortedSet[Int] =
TreeSet(1, 2, 3)