-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use helper constructors to instantiate type classes #3870
Comments
Unfortunately this is mostly useful only for Scala 3 |
I looked for a scalafix rule but it doesn't exist yet. |
What makes this mostly useful only for Scala 3? |
There is a problem in Scala 2 for SAM traits with method implementations (i.e. having concrete methods that derive from the single abstract one which all type classes in Cats do):
Anyway long story short, I found it's anyway good to use The trick with the instance constructors is that we are passing one function at a time as arguments and they are guaranteed to be delambdafied and not generate class files. |
@joroKr21 From the last message, can we understand that you would like to withdraw this proposal? Is this something that should be reconsidered once we deprecate Scala 2.13? |
@diesalbla no, the proposal just evolved to using helper |
Since we don't support Scala 2.11 anymore this is an option.
See https://www.scala-lang.org/news/2.12.0/
"No class file is generated" sounds pretty good to me 🤓
The text was updated successfully, but these errors were encountered: