O'Reilly logo

Pragmatic Scala by Venkat Subramaniam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Wrapping Up

In this chapter, you saw one of the most powerful features of Scala. Right off the shelf, you can match simple literals, types, tuples, lists, and so on. If you want a bit more control on the matching, you can use the case class or the all-too-charming extractors. You also saw how regular expressions manifest as extractors. If you want to match simple literals, the match is quite adequate. If you want to match arbitrary patterns, Scala extractors are your friend. You’ll see pattern matching shine in concurrent programming later in this book.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required