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 Nondeterminism instance for Kleisli/ReaderT #2262

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Atry
Copy link
Collaborator

@Atry Atry commented Dec 29, 2021

No description provided.

@Atry Atry requested a review from xuwei-k as a code owner December 29, 2021 05:02
Kleisli { r =>
F.map(F.chooseAny(head(r), tail.map(_(r)))) {
case (chosen, notChosen) =>
(chosen, notChosen.map(fa => Kleisli(_ => fa)))
Copy link
Collaborator Author

@Atry Atry Dec 30, 2021

Choose a reason for hiding this comment

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

Kleisli(_ => fa) might be incorrect, because it would discard the any new values.

Shall we change the required function of Nondeterminism to firstCompletedOf as mentioned by #2255

It is hard to implement chooseAny correctly and efficiently

@Atry Atry marked this pull request as draft December 30, 2021 05:28
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.

None yet

1 participant