Please log in to watch this conference skillscast.
Context functions made their debut in Scala 3.0, but are still alien to many Scala developers. In my talk I’d like to tame the beasts and benefit from them.
First, I will start with the basics. I am going to explain where the idea of context functions came from and what problem they intended to solve. Then I will show how to put them to work by creating simple DSL.
Subsequently, we’ll get to know the unexpected sides of the beasts: How they interact with type inference, the weirdest part of the context functions. I’ll go into more detail and explain why context functions behave differently from ordinary functions in the type system.
Lastly, I’ll tackle an important question: “Is it true that context functions don’t compose well?” I’ll show the common pitfalls and how to avoid them, and I’ll reveal some nifty hacks that I came across while experimenting.
I hope that after this talk, the listeners will be able to use and understand context functions but also understand where and how they can safely use them and where they should avoid them.
YOU MAY ALSO LIKE: