-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Widen parLiftN's constraint to NonEmptyParallel #4702
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
base: main
Are you sure you want to change the base?
Conversation
Unfortunately we have no MiMa support here, because syntax classes are It's arguably a bug that methods on private classes are publicly usable. |
okay, I was able to follow your advice from Discord and just created a new copy of the syntax class, except the old implicit conversion has been made non-implicit. I tested it with the following:
//> using dep org.typelevel::cats-core:2.13.0
import cats.syntax.all.*
case class Foo(a: Int, b: String)
object demo extends App {
def foo(a: Either[String, Int], b: Either[String, String]) = (Foo.apply _).parLiftN(a, b)
println(foo(Left("error"), Right("hello")))
}
#!/usr/bin/env bash
set -e
set -x
for sv in 2.12 2.13 3
do
echo "compiling $sv"
if [ "$sv" == "2.12" ]; then
EXTRA_FLAGS="-Ypartial-unification"
else
EXTRA_FLAGS=""
fi
scala-cli compile main.scala --output-directory out --scala "$sv" -Xsource:3 $EXTRA_FLAGS
DEPS=$(cs fetch org.typelevel:cats-core_$sv:2.13.0-4-2d82b53-SNAPSHOT --classpath)
echo "running: "
java -cp "$DEPS:out" 'demo'
done It succeeds in all versions. Does that sound about right? |
I mean... Maybe no one even notice :) |
Your call 😅 |
ThisBuild / tlBaseVersion := "2.12" | ||
ThisBuild / tlBaseVersion := "2.13" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fyi: #4704
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this PR should bump to 2.14. It's making source-breaking changes and forwards binary-breaking changes, with respect to Cats v2.13.x so we need to bump the minor to reflect that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are the changes source-breaking?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kubukoz , I'm wondering too: #4704 (comment)
Perhaps there's some mystery to be unraveled :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are the changes source-breaking?
This code compiles in 2.13, but won't after these changes.
object syntax extends cats.syntax.FunctionApplySyntax
import syntax.*
fn.liftN(...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm I wonder if we can make the old syntax trait extend the new. Still, if someone hand-picks their imports they'll be source-broken. Do we care about this use case?
I don't suppose we'll release a 0.14 soon...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still, if someone hand-picks their imports they'll be source-broken. Do we care about this use case?
Yes, that's the point. Whenever we make any change like this, it is technically source-breaking.
To clarify, I'm not saying we should avoid source-breaking changes: this makes it impossible to add new features. What I'm saying is that, because these typical changes are source-breaking, we have to bump the base version.
Drafting to see what mima says...