Skip to content
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

WIP: upgrade to arrow 2.0 #83

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

Conversation

hugomd
Copy link
Collaborator

@hugomd hugomd commented May 21, 2024

To Do

  • Move outcome to a non-continuations package
  • Add deprecation warnings, with migration paths
  • Determine whether OutcomeEffectScope is sufficient in-place of OutcomeEagerEffectScope. I believe this no longer enforces non-suspending functions
  • Changelog
  • Upgrade Arrow in kotest-extensions-arrow to fix conflicts
  • Remove quiverTraverse

Notes

Please see arrow-kt/arrow#2778

Validated has been deprecated, and is no longer included in Arrow.
This patch backports ValidatedNel as an alias of an underlying type, and
maintains the existing extensions.
Continuations have been deprecated in favour of the Raise DSL.

I have removed OutcomeEagerEffect scope, as the Raise DSL does not
expose an eager implementation to be extend. Instead, the expectation is
that the caller wraps calls in `eagerEffect`. This binds the suspended
function to an eager context.
@CLAassistant
Copy link

CLAassistant commented May 21, 2024

CLA assistant check
All committers have signed the CLA.

@hugomd hugomd marked this pull request as draft May 21, 2024 07:45
@nomisRev
Copy link
Contributor

Awesome seeing this @hugomd 👏 👏

I'm a bit busy during KotlinConf, but during the summer we're going to work hard relaxing 2.0.0 (final). I will regularly check in here how things are going, but if you come across anything weird please let me know, and tag me and I'll be happy to help in whatever way I can ☺️

Comment on lines 16 to 19
// TODO(hugom): move this into an effect package, instead of continuations to align with arrow (?)
@JvmInline
value class OutcomeEagerEffectScope<E>(private val cont: EagerEffectScope<Either<Failure<E>, Absent>>) :
EagerEffectScope<Either<Failure<E>, Absent>> {
value class OutcomeEffectScope<E>(private val cont: Raise<Either<Failure<E>, Absent>>) :
Raise<Either<Failure<E>, Absent>> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be removed, I contributed a Raise impl last year in the raise package.

https://github.com/cashapp/quiver/blob/main/lib/src/main/kotlin/app/cash/quiver/raise/OutcomeBuilder.kt

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! I'll look at migrating some of our existing codebases over to OutcomeRaise and see how it works out before removing 👍🏻

kotest-extensions-arrow has not yet been upgrade to arrow 2.0.0, so
we're seeing compatibility issues with some of the older
implementations.

In the meantime, we can add our own Arb to make tests pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants