Note: This tutorial is an excerpt from the Scala Cookbook, 2nd Edition.
As you can tell from one look at the Scaladoc for the collections classes, Scala has a powerful type system. However, unless you’re the creator of a library, you can go a long way in Scala without having to go too far down into the depths of Scala types. But once you start creating libraries for other users, you will need to learn them. This chapter provides recipes for the most common type-related problems you’ll encounter.
Scala’s type system uses a set of symbols to express different generic type concepts, including the concepts of bounds, variance, and constraints.