Book Image

Learn Scala Programming

By : Slava Schmidt
Book Image

Learn Scala Programming

By: Slava Schmidt

Overview of this book

The second version of Scala has undergone multiple changes to support features and library implementations. Scala 2.13, with its main focus on modularizing the standard library and simplifying collections, brings with it a host of updates. Learn Scala Programming addresses both technical and architectural changes to the redesigned standard library and collections, along with covering in-depth type systems and first-level support for functions. You will discover how to leverage implicits as a primary mechanism for building type classes and look at different ways to test Scala code. You will also learn about abstract building blocks used in functional programming, giving you sufficient understanding to pick and use any existing functional programming library out there. In the concluding chapters, you will explore reactive programming by covering the Akka framework and reactive streams. By the end of this book, you will have built microservices and learned to implement them with the Scala and Lagom framework.
Table of Contents (19 chapters)

Preface

Today's Scala is quite different from its earlier versions.

The second version of the language is more than twelve years old, and underwent multiple changes related to supported features and library implementation. Many features then considered crucial, such as support for XML literals, Swing, and Actors, were moved from the language core to the external libraries or replaced by open source alternatives. Another functionality that makes Scala the programming language as we know it today were added directly, or by including yet another open source library in the distribution. The most notable example is adopting Akka in version 2.10.

Scala 2.13, with its focus on modularizing standard libraries and simplifying collections, entails a further change. The changes, however, do not only affect the technical side of Scala. Years of using it to solve real problems have helped us to collect more knowledge about structuring functional programs and using object-oriented features in new ways to our advantage. The same way as it was customary to use earlier versions of Scala as "Java without semicolons," it is now routine to build programs using monad transformers and type-level programming techniques.

This book addresses both technical and architectural changes by providing a comprehensive guide to the redesigned standard library and collections, as well as covering type systems and first-level support for functions in depth. It discusses implicits as a primary mechanism for building type classes and looks at different ways of testing Scala code. It covers in detail abstract building blocks used in functional programming, affording sufficient knowledge to pick up and use any existing functional programming library out there. It explores reactive programming by covering the Akka framework and reactive streams. Finally, it talks about microservices and how to implement them with Scala and the Lagom framework.