-
Notifications
You must be signed in to change notification settings - Fork 453
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
FixIor
deprecation replacement expressions
#2976
Conversation
cf80546
to
5ddd70f
Compare
Kover Report
|
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.
Just a couple of questions. Looks good to me
) | ||
public fun <A, B, C> Ior<A, B>.zip(SA: Semigroup<A>, fb: Ior<A, C>): Ior<A, Pair<B, C>> = | ||
ior(SA::combine) { Pair(this@zip.bind(), fb.bind()) } | ||
|
||
@Deprecated( | ||
NicheAPI + "Prefer using the inline ior DSL", | ||
ReplaceWith("ior(SA::combine) { map(this@zip.bind(), c.bind()) }", "arrow.core.raise.ior", "arrow.typeclasses.combine") | ||
ReplaceWith("ior({a, b -> a + b}) { map(this.bind(), c.bind()) }", "arrow.core.raise.ior") |
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 think @serras has asked this in another PR, but being A
a generic type, this code won't compile unless we run it under the scope of a Semigroup
instance, will it?
Additionally, why do you use the SA::combine
function in this ReplaceWith
expression and use the plus
operator in the rest of zip
alternatives?
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.
This was actually a bug 😅 . Good catch, @franciscodr !. See 133847c
(#2976)
NicheAPI + "Prefer when or fold instead", | ||
ReplaceWith(" MN.run { fold({ f(it) },{ g(it) },{ a,b -> f(a).combine(g(b)) })}") | ||
) | ||
@Deprecated(NicheAPI + "Prefer when or fold instead. See the Arrow web migration guide for more info.") |
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.
Have we created a task for adding these changes to the migration guide?
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've just created it 😄 . Thanks for the suggestion, @franciscodr!
This PR fixes some of the deprecation
ReplaceWith
suggestions forIor
listed in #2964. I'll update the issue table once this is merged.And for those replacements that are no working, a section will be created in Arrow website, explaining the best way to migrate these methods.