I am really loving this channel. As someone who has always hated implicits in Scala, I really welcome not only the new given/using, but how this channel explains things so well...
The latest intellij (2021.2.1) doesn't seem to offer Dotty per se, but does offer Scala 3 It looks like Givens have changed, "as" isn't accepted, but this is given standardPersonOrdering: Ordering[Person] with { override def compare(x: Person, y: Person): Int = x.surname.compareTo(y.surname) }
Hi, I am not getting Scala options even after installing plugins during new project creation....I am trying with community edition 2022.2.x, SBT 1.7.1 and scala3.x...pls suggest
The implicit keyword was overloaded with 3 different goals, which are now split for easy comprehension: - implicit args/values/generators -> now givens - implicit conversions -> now you need to bend over backwards to do them - implicit classes -> now extension methods
Great video, now I understand how type-classes are implemented in Scala. Pretty neat that you can name the "instances", helping you avoid instance clashes. Could you share how to build and deploy Scala (pref. 3) code? I had a hard time trying to build and deploy self-contained apps (single executable, no *.jar, no JVM prerequisite) in Java/Kotlin, so I would like to know how could you achieve this in Scala.
Can't wait for the new type-level program series on Scala 3!
Soon to come!
I am really loving this channel. As someone who has always hated implicits in Scala, I really welcome not only the new given/using, but how this channel explains things so well...
Thanks, Eric, really glad you like the stuff here!
The latest intellij (2021.2.1) doesn't seem to offer Dotty per se, but does offer Scala 3
It looks like Givens have changed, "as" isn't accepted, but this is
given standardPersonOrdering: Ordering[Person] with {
override def compare(x: Person, y: Person): Int = x.surname.compareTo(y.surname)
}
Yep.
They just announced new syntax for importing givens, by the way - check the blog. Awesome video though, as always!
Thanks!
Hi, I am not getting Scala options even after installing plugins during new project creation....I am trying with community edition 2022.2.x, SBT 1.7.1 and scala3.x...pls suggest
Writing out the "optionOrdering" given clause gives me a syntax error. Bloop tells me "not found type optionOrdering". Maybe I'm missing something.
That was a damn good introduction.
Glad to hear it!
given/using is just like implicit right? i wonder why they did this, maybe it's easier to trace the plumbing instead of the "wifi" of implicits.
The implicit keyword was overloaded with 3 different goals, which are now split for easy comprehension:
- implicit args/values/generators -> now givens
- implicit conversions -> now you need to bend over backwards to do them
- implicit classes -> now extension methods
Great video, now I understand how type-classes are implemented in Scala. Pretty neat that you can name the "instances", helping you avoid instance clashes.
Could you share how to build and deploy Scala (pref. 3) code? I had a hard time trying to build and deploy self-contained apps (single executable, no *.jar, no JVM prerequisite) in Java/Kotlin, so I would like to know how could you achieve this in Scala.
Glad it helped! Scala 3 isn't out yet, so it might take a bit before we have this in a real-life scenario, but we're getting there!
Did the mechanism of getting implicit types from the object of an involved type go away in Scala 3?
wdym?
@@rockthejvm It's just that you didn't mention that mechanism for satisfying the implicit/given type.
please help me to identify how it is different from Implicit?
The given/using clauses will replace the implicit mechanism. Video coming today!