Scala 2.13 is a minor update of Scala with the main focus on the redesigned collection library. The few small additions to the standard library, such as automatic resource management, just accentuate this fact.
The new collection library mainly consists of two intermixed inheritance hierarchies with a similar shape. Members of the first hierarchy describe the structure of the collection and members of the second hierarchy—operations available on this collection type. Because of the inheritance relations, the collections situated lower in the tree define additional methods for more specific collections and override methods defined by the parent traits to provide more efficient implementation as required.
The three main collection types are Seq, Set, and Map. Each of these types has multiple implementations that are useful in specific situations. Set is also a function of one argument; Seq and Map are PartialFunctions.
Most of the collections are available in mutable and immutable forms.
In addition to the collection hierarchies, there is a concept of View, which is a reified definition of iterators’ operations and can be used to lazily apply transformations to the collection. Another related abstraction is IterableFactory, which implements some general ways to create collection instances and to perform conversions between collection representations.
In the next chapter, we will shift our focus from the new features of version 2.13 to a general exploration of Scala, starting with its type system.