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

parser: replace closures with currying #298

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Kijewski
Copy link
Collaborator

Rebased on #297.

IMHO the code more readable with fewer closures.

@GuillaumeGomez
Copy link
Contributor

I'm not a big fan of this approach. I like the changes in the second commit but not in the first. Reading closure makes it much easier to both read and actually know what's going on whereas with the Unbound trait, you actually need to go check where this bind method comes from to understand what it's doing.

@Kijewski
Copy link
Collaborator Author

I mean, you can always grep for fn bind. And bind is phrase used in multiple languages for partial-applications. IMHO the invocations are self-explanatory, the current closures aren't.

@GuillaumeGomez
Copy link
Contributor

It's generic, whereas closures are directly part of the winnow API and are easy to update if needed. IMO it's code obfuscation, not really an improvement.

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