Overview
Scala is a concise, object-oriented language with functional programming features, including currying, type inference, immutability, lazy evaluation, and pattern matching. Scala code runs on a JVM and was designed to address some of the shortcomings of Java.
In this instructor-led, live training participants will learn how to use Scala’s advanced features, including its type system, to write better code using an object-functional approach.
By the end of this training, participants will be able to:
- Leverage Scala’s type system to maximum benefit
- Handle exceptions functionally
- Create libraries and DSLs with Scala
- Use Scala’s advanced features for pattern matching
Format of the course
- Part lecture, part discussion, exercises and heavy hands-on practice
Requirements
- Hands on experience in Scala programming
- Familiarity with pattern matching and traits
Audience
- Scala programmers who wish to learn the more advanced and nuanced features of Scala
Course Outline
Introduction
- Scala as a JVM language
- Objection-oriented programming vs functional programming
Overview of Object-Functional Programming
- Tail recursion
- Partial functions
- Currying and partial function application
- Closures
- Lazy evaluation
Mastering the Scala Type System
- About traits
- Structural types
- Path dependent types
- Self types
- Covariance and contravariance
- Type bounds
Advanced Pattern Matching in Scala
- Deep matching
- Using extractors
Using Scala Implicit
- Implicit conversion, classes and parameters
- Type class pattern
- Context and view bounds
Libraries and DSLs
- Custom control structures with by-name parameters
- Building well-designed libraries and internal DSLs
Working with Scala Collections
- Working with Streams
- Manifests and class tags
- Builders
- CanBuildFrom
- Building custom collections
Functional Exception Handling
- Traditional exception handling
- Functional exception handling
- Using Try with For comprehensions
Closing Remarks