Scala 3 RC3 is already here and we can expect the final release on the 12th of May if no major bugs are found! That's why it's a good timing for playing around and seeing what's there. In this workshop we'll see the most interesting and important features like enums, contextual abstractions (givens, extension methods, type classes, context functions), new types (opaque, unions and intersections). We'll also see what's dropped and what changed. During the exercises, you'll be refactoring Scala 2 to Scala 3 yourself using the new shiny constructs.
This workshop is dedicated to Scala 2 developers and assumes prior knowledge about implicits, ADTs and type classes.
- Checkout this repository
git clone [email protected]:bszwej/scala-3-crash-course.git
- Compile with sbt
sbt compile
- Import it in your favorite IDE
- VSCode + metals (recommended)
- Intellij
- Braceless syntax
- Enums
- Contextual language features:
- given/using
- extension methods
- type classes
- implicit conversion
- scoping of given/using
- contextual functions
- Opaque types
- Union and Intersection types
- The small bits
- (In preparation) New kinds of types: type lambdas, match types, dependent functions, polymorphic functions
- (In preparation) Type class derivation
- (In preparation) Macros
Solutions to all exercises can be found in the solutions
package.