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 hints for replacing some maybe usage with equivalent traverse #1543

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

Conversation

googleson78
Copy link
Contributor

No description provided.

@ndmitchell
Copy link
Owner

Why is this desirable? The maybe function is more targeted so helps enforce types better.

@googleson78
Copy link
Contributor Author

I personally find it desirable because the maybe usage is essentially reimplementing traverse, i.e. this is exactly the implementation of traverse.

I do agree that type inference is worse with this hint, and potentially (although I'm not sure when), this might cause ambiguity errors. Perhaps some optional group might be better here?

@ndmitchell
Copy link
Owner

Definitely not in base, which in general doesn't do generalization. But further down there is a set of hints called generalised, where maybe to traverse would fit nicely. Happy to take the patch if adjusted to go there.

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