Option and Either
- Option. Option types absence: map over it, getOrElse at the edge, never null-check chains.
- Either. Either carries success or a typed error: Right is the value, Left names what failed.
- Try. Try captures thrown exceptions as values: the bridge from exception land to typed failure.
Effectful Computation Concepts
- Effects as values. Effect systems model side effects as values: descriptions composed, then run at the end of the world.
- IO awareness. An IO value describes an action without performing it: composition and retry as data.
- Choosing your level. Teams choose their effect level: plain Futures, or full effect systems: one policy, stated.
Reliable Functional Error Handling
- Errors in signatures. Typed errors live in signatures: Either[PaymentError, Receipt] tells callers everything.
- Accumulating errors. Validation accumulates errors instead of failing fast: forms report all problems at once.
- Boundary translation. Exceptions from Java translate at the boundary: inside, failure is data.
Before and after this level
- Before: Level 7: Scala 3 Features: Givens and Contextual Abstractions, Extension Methods, Modern Scala Design.
- Next: Level 9: Concurrency: Futures, Concurrent Programming, Functional Concurrency Patterns.
In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.
Frequently asked questions
What does Scala Level 8: Errors & Effects cover?
Option and Either, Effectful Computation Concepts, Reliable Functional Error Handling: 3 lessons and 9 ideas.
What should I know before this level?
The level before it, Level 7: Scala 3 Features, which covers Givens and Contextual Abstractions, Extension Methods, Modern Scala Design.