Amazing how you make these implicitly abstract scala concepts looks explicitly concrete. Just enjoy your way of simplifying things.
@JasonYeo3 жыл бұрын
So why did the Scala team introduce givens and usings? How does that improve the implicits situation? The given resolution order is the same as before and now it seems like these are just new keywords for the an old concept. It's basically putting old wine in new bottles.
@BloodnutXcom3 жыл бұрын
Implicit keyword becomes deprecated. Scala 3.0 is still backwards compatible but later implicit will be removed.
@-Wessel3 жыл бұрын
I think the reason is the name implicit was confusing because: - The name does not imply what it does - the implicit keyword is used for different things that are completely seperate from each other. The new keyword names adress these 2 things. I guess it's like a refactoring of the language: Same functionality but more comprehensible syntax.
@sergeydev82733 жыл бұрын
Like, then watching :)
@BloodnutXcom3 жыл бұрын
tldr: givens+using are interchangable with implicit
@rockthejvm3 жыл бұрын
Pretty much - with a bit of background about how the compiler works with them
@Nebulorum3 жыл бұрын
Are there differences between given and implícits, or are they just an alias of each other?
@jimaaman3 жыл бұрын
I too am wondering this. Are there compiler optimizations or some other benefit to using/given besides constraining the application of implicits?
@rockthejvm3 жыл бұрын
Givens are not aliases of implicits. They have a different mechanism, it's only how the compiler looks for such values that's the same (so they can work interchangeably). The goal of using/given was indeed to constrain the power of implicits, because they were often misused.