Term Inference with given and using (Scala 3 Video)
In this free Scala 3 training video, I show how to use Term Inference in Scala 3 with the given
and using
keywords.
If you’re familiar with implicits in Scala 2, the new given
and using
approach in Scala 3 replaces this use of the implicit
keyword. It was believed that the implicit
keyword was too overloaded in Scala 2, so it was replaced by given
definitions that you create, and then using
declarations as your function/method input parameters.
This video also takes a look at how to import given
values in Scala 3. This approach was also updated to make it more obvious where given
values are coming from; this was done to help reduce the confusion that seemed to exist in Scala 2.
Update: All of my new videos are now on
LearnScala.dev