Scala 3 — Book
Summary
Language
Info: JavaScript is currently disabled, code tabs will still work, but preferences will not be remembered.
This chapter provides an introduction to most Contextual Abstractions topics, including:
- Extension Methods
- Given Instances and Using Clauses
- Context Bounds
- Given Imports
- Type Classes
- Multiversal Equality
- Implicit Conversions
These features are all variants of the core idea of term inference: given a type, the compiler synthesizes a "canonical" term that has that type.
A few more advanced topics aren’t covered here, including:
- Conditional Given Instances
- Type Class Derivation
- Context Functions
- By-Name Context Parameters
- Relationship with Scala 2 Implicits
Those topics are discussed in detail in the Reference documentation.