-
Notifications
You must be signed in to change notification settings - Fork 67
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
Update core-tests, zio to 1.0.0-RC12 #50
Update core-tests, zio to 1.0.0-RC12 #50
Conversation
Fixed deprecation errors. Seems ZIO Test wasn't released for 2.12 because of a scaladoc issue, will have to re-release it. |
@@ -421,7 +421,7 @@ object Schedule { | |||
* @see zio.ZSchedule.succeedLazy | |||
*/ | |||
final def succeedLazy[F[+_], A](a: => A): Schedule[F, Any, A] = | |||
new Schedule(ZSchedule.succeedLazy(a)) | |||
new Schedule(ZSchedule.succeed(a)) |
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.
I guess this function should be
- implemented as
forever.as(a)
to preserve previous laziness - deprecated
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.
Oh right
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.
Same here, succeed
is already lazy
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.
No, it will evaluate on call - https://github.com/zio/zio/blob/master/core/shared/src/main/scala/zio/ZSchedule.scala#L727 - although it's not important now if even zio-core's succeedLazy
is now also strict anyway
@@ -124,7 +124,7 @@ private class CatsZManagedMonad[R, E] extends Monad[ZManaged[R, E, ?]] { | |||
override def flatMap[A, B](fa: ZManaged[R, E, A])(f: A => ZManaged[R, E, B]): ZManaged[R, E, B] = fa.flatMap(f) | |||
|
|||
override def tailRecM[A, B](a: A)(f: A => ZManaged[R, E, Either[A, B]]): ZManaged[R, E, B] = | |||
ZManaged.succeedLazy(f(a)).flatMap(identity).flatMap { | |||
ZManaged.effectTotal(f(a)).flatMap(identity).flatMap { |
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.
The tests should now pass with ZManaged.suspend
instead of this construct. Could you please check?
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.
Ok I’ll try
@@ -220,7 +220,7 @@ object STM { | |||
final def succeed[F[+_], A](a: A): STM[F, A] = new STM(ZSTM.succeed(a)) | |||
|
|||
final def succeedLazy[F[+_], A](a: => A): STM[F, A] = | |||
new STM(ZSTM.succeedLazy(a)) | |||
new STM(ZSTM.succeed(a)) |
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.
Ought to deprecate AND preserve laziness with ZSTM.unit.as(a)
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 succeed
is already lazy
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.
Err, no, a
is not by-name, it will evaluate a
when applied, not when evaluated. https://github.com/zio/zio/blob/master/core/shared/src/main/scala/zio/stm/STM.scala#L766
You could say that ZSchedule.succeedLazy
is already strict because it immediately evaluates when calling succeed
(a change in this PR that went unnoticed zio/zio#1377). Actually, I think just putting a deprecation here should be enough (you can call deprecated methods inside deprecated methods without a warning AFAIK)
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.
Oops, my bad. OK I'll keep calling the deprecated one since this one is deprecated.
I think I should fix STM#die at least because it's not deprecated, the rest shouldn't matter. |
Ah actually the original STM#die is doing the same thing so I guess we're good? |
👍 |
Updates
from 1.0.0-RC11-1 to 1.0.0-RC12.
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention @scala-steward in the comments below.
Have a fantastic day writing Scala!
Ignore future updates
Add this to your
.scala-steward.conf
file to ignore future updates of this dependency:labels: semver-pre-release