1 / 11
A 437-page, practical guide to learning Scala 3 from zero — case classes, enums, pattern matching, traits, collections, Option and Either, for-comprehensions, givens, type classes, testing, futures, JSON, and two complete projects.
A Complete, Practical Guide to Functional and Object-Oriented Programming with Scala 3
Read before you buy: the PDF here is a free sample — the first 20 pages of the 437-page book (payments, sales and reviews on this demo site are sample data). Get the full e-book at thenexbooks on Gumroad.
Scala has a reputation for being complicated. It doesn't have to be.
Scala blends object-oriented and functional programming: classes, objects, and traits on one side; immutable data, functions as values, and pattern matching on the other. Scala 3 makes that combination cleaner than ever — but most tutorials still throw advanced features at you before the basics make sense. This book does the opposite.
We start from zero — installing Scala and writing your first program — and add one idea at a time, always explaining why Scala works the way it does. When the compiler rejects your code, we read the message together and treat it as a teacher. Along the way you grow "brightspoke", a fleet manager for a small fictional bike rental shop, from a few values into a complete, tested command-line application with a small JSON API.
- 437 pages · 28 chapters + 4 appendices · practice exercises in every chapter
- Scala CLI, sbt, the REPL, and editors with Metals or IntelliJ
- Values, types, expressions, functions, classes, objects, and companions
- Case classes, enums, algebraic data types, and pattern matching
- Traits, packages, and real sbt projects
- Functional programming: higher-order functions, collections, Option, Either, Try, for-comprehensions, recursion, and folds
- Generics and variance, given/using, extension methods, type classes, opaque, union, and intersection types
- Testing with MUnit and property-based tests, Futures, files and JSON with os-lib and uPickle
- Command-line apps, Java interoperability, and a first look at Cats Effect and ZIO
- Two projects: a complete CLI and a small JSON API with Cask
- A compiler error field guide that explains the messages beginners meet most often
- Written for Scala 3
Table Of Contents
Part I — Getting Started
- Ch 1 · Why Scala? What It Is, Where It Is Used, and Who It Is For
- Ch 2 · Installing Scala: Scala CLI, sbt, the REPL, and Your First Program
- Ch 3 · Values, Variables, and Basic Types
- Ch 4 · Expressions, Control Flow, and Functions
- Ch 5 · Classes, Objects, and Companion Objects
Part II — Core Language
- Ch 6 · Case Classes and Immutable Data
- Ch 7 · Enums and Algebraic Data Types
- Ch 8 · Pattern Matching in Depth
- Ch 9 · Traits, Mixins, and Composition
- Ch 10 · Packages, Imports, and Projects with sbt
Part III — Functional Programming
- Ch 11 · Functions as Values: Lambdas, Higher-Order Functions, and Currying
- Ch 12 · Collections: List, Vector, Set, Map, and the Collections API
- Ch 13 · Option, Either, and Try: Handling Absence and Errors Without Exceptions
- Ch 14 · For-Comprehensions: map, flatMap, and Sequencing Computations
- Ch 15 · Recursion, Folding, and Thinking Immutably
Part IV — Types and Abstractions
- Ch 16 · Generics, Variance, and Type Bounds
- Ch 17 · Contextual Abstractions: given, using, and Extension Methods
- Ch 18 · Type Classes in Scala 3
- Ch 19 · Opaque Types, Union and Intersection Types, and Other Scala 3 Type Features
- Ch 20 · Testing with MUnit and Property-Based Testing
Part V — Practical Scala
- Ch 21 · Concurrency with Futures
- Ch 22 · Files, JSON, and Persistence with os-lib and uPickle
- Ch 23 · Building Command-Line Applications
- Ch 24 · Working with Java: Interoperability in Both Directions
- Ch 25 · An Introduction to Effect Systems: Cats Effect and ZIO
Part VI — Projects and Next Steps
- Ch 26 · Project: The Brightspoke Fleet CLI End to End
- Ch 27 · Project: A Small JSON API with Cask
- Ch 28 · Idiomatic Scala, Performance Basics, Publishing Libraries, and Where to Go Next
Appendices
- App A · Scala 3 Syntax Cheat Sheet
- App B · sbt, Scala CLI, and Libraries Reference
- App C · Compiler Error Field Guide
- App D · Glossary
WHO IT IS FOR
Developers who know another language (Java, Python, JavaScript/TypeScript, Kotlin, or C#) and want to learn Scala 3 properly; motivated beginners with a little programming experience; Java developers looking for a more expressive language on the JVM; and anyone curious about functional programming who wants to learn it through practical code.
FORMAT
PDF (A4), 437 pages, English, clickable table of contents and PDF bookmarks. 1st Edition, 2026. Published by thenexbooks.
This book is independent and is not affiliated with, sponsored by, or endorsed by EPFL, the Scala Center, or any company mentioned. Scala is a trademark of EPFL. Java is a trademark of Oracle and/or its affiliates.
Book details
| Detail | |
|---|---|
| Pages | 437 |
| Format | PDF (A4) |
| Language | English |
| Level | Beginner to Intermediate |
| Edition | 1st Edition, 2026 |
| Download on this site | Free sample, first 20 pages (PDF) |
| Publisher | thenexbooks |
Files you get
No reviews yet. Only buyers can review.
More from thenexbooks