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 3
Intermediate Scala Collections
Content Locked
Section 5
Intermediate for Comprehensions
In this video, we will perform side effects and pattern matches for comprehensions. - Recall existing uses of for comprehensions - Interject side effects into comprehensions for debug printing - Use pattern matching to simplify your comprehensions