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

Add iorNel builder and Ior.toIorNel function #3114

Merged
merged 7 commits into from
Nov 9, 2023

Conversation

sampengilly
Copy link
Contributor

No description provided.

@sampengilly
Copy link
Contributor Author

Unfortunately we can't easily have something like a .bindNel() extension function on an Ior inside an iorNel block without either duplicating IorRaise (or opening it for extension). Context receivers could help here going forward. For the initial submission I've kept it simple with an additional converter function to convert an Ior to an IorNel before binding normally

@sampengilly
Copy link
Contributor Author

It will probably be necessary to build a new IorNelRaise<Error> type I think. If we want to be able to bind individual Error items within the raise block for a nicer API:

fun someEitherFunc() = Throwable().left()

iorNel<Throwable, Nothing> {
    someEitherFunc().bind()
    // vs
    someEitherFunc().mapLeft { it.nel() }.bind()
}

@serras
Copy link
Member

serras commented Oct 19, 2023

@sampengilly could you please run ./gradlew apiDump on this branch and commit the results? The automatic .api updater doesn't seem to work in forks :/

@serras serras merged commit 6fb6a75 into arrow-kt:main Nov 9, 2023
10 checks passed
@sampengilly sampengilly deleted the iorNel-builder branch November 9, 2023 11:09
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.

2 participants