Book Image

Scala Intermediate Recipes [Video]

By : Antonio Salazar Cardozo
Book Image

Scala Intermediate Recipes [Video]

By: Antonio Salazar Cardozo

Overview of this book

Now that we have the easy stuff out of the way, we take delve into some of Scala's more powerful features. Pattern matching is Scala's tremendous ability to deconstruct data in intuitive and readable ways, letting you write safely in a few lines of code what other languages can take tens of buggy lines to get across. We'll explore the various ways that patterns can be used, as well as some of the more advanced functionality that they hide. A quick detour into testing will introduce the specs2 library and how to use it to do behavior-driven development in Scala. Then we'll dig into Scala's collections some more; Scala's collections library is vast, and holds many powerful tools for dealing with data. Finally, we'll go through a few tricks that let you get readable and type-safe frameworks in place to describe your domain.
Table of Contents (4 chapters)
Chapter 1
Scala Pattern Matching
Content Locked
Section 2
Basic Pattern Matching
In this video, we will review and understand the basics of pattern matching, including nested matches and alternates. - Understand basic pattern matching with options - Learn how to pattern match with conditions and nested matches - Investigate easier ORs with pattern alternates