Skip to content

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