Day 3 -

Aug 20th

Stage 4

11:00 - 11:40

Yo Dawg, Heard You Want To FlatMap Your Direct-Style

The direct style in Scala 3, influenced by languages like Kotlin and Rust, simplifies functional programming by eliminating for-comprehension syntax on higher-kinded types. It offers an imperative approach supported by context functions.

While many Scala developers support it, others prefer the traditional functional styles used in libraries like Cats Effect and ZIO, which manage effects differently. The potential of combining Algebraic Effects and Handlers with Scala 3’s direct style opens new possibilities for exploring different programming paradigms and libraries.

During the talk, we’ll build a small effect system using solely Scala 3 context functions step by step. With some enhancements to the common approach, we’ll discover that adding for-comprehension capabilities to such a system is possible. We’ll end up with a system that can express the same program using either direct style syntax or monad style.

Riccardo Cardin

I’m a passionate software engineer working on distributed systems. I’ve been an enthusiastic Scala developer since 2013, and I love writing and sharing my experience in computer programming. In my spare time, I’m a gym rat at my home gym, practicing karate.

Subscribe

Join our conference

Subscribe and follow @ScalaDays on BlueSky for the latest conference updates.