Skip to content

consumeWith: propagate consumed flag when it was set #237

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

Merged
merged 1 commit into from
Mar 6, 2025

Conversation

Hi-Angel
Copy link
Contributor

@Hi-Angel Hi-Angel commented Mar 1, 2025

Description of the change

The Parsing design implies that if input was consumed, it must propagate further unless try is used to reset that.

Fixes: #236


Checklist:

  • Added the change to the changelog's "Unreleased" section with a link to this PR and your username
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation in the README and/or documentation directory
  • Added a test for the contribution (if applicable)

@Hi-Angel
Copy link
Contributor Author

Hi-Angel commented Mar 1, 2025

FTR, I tried running tests locally, and I'm not sure what's up with them but I get a:

╰─λ spago test
[error] Module 'Test.Main' not found! Are you including it in your build?

I looked at README for the hints/instructions, but to no avail. Suggestions are welcome.

@Hi-Angel Hi-Angel changed the title consuemWith: propagate consumed flag it was set consumeWith: propagate consumed flag it was set Mar 1, 2025
@Hi-Angel
Copy link
Contributor Author

Hi-Angel commented Mar 1, 2025

FTR, I tried running tests locally, and I'm not sure what's up with them but I get a:

I found at the top of the tests file a note on using spago -x spago-dev.dhall test. I was about to add documentation about it, but then turned out it is in a separate document "contributing".

I am not exactly what to do here, but I'd honestly move whole "contributing" file to the README.md, because it's only a dozen of lines long (so there isn't much benefit in having it separately), but README is large so nobody's gonna read every lien of it. I cursory skimmed through the content and also search in a browser for test keyword, and in absence of anything relevant concluded it's not documented

@Hi-Angel Hi-Angel force-pushed the fix-takeWhile branch 2 times, most recently from fd22404 to e3cdbd6 Compare March 1, 2025 21:17
@Hi-Angel
Copy link
Contributor Author

Hi-Angel commented Mar 1, 2025

UPD: added a test. Ready for review.

@Hi-Angel Hi-Angel force-pushed the fix-takeWhile branch 4 times, most recently from 6464867 to 146cf37 Compare March 1, 2025 22:03
The Parsing design implies that if input was consumed, it must
propagate further unless `try` is used to reset that.

Fixes: purescript-contrib#236
@Hi-Angel Hi-Angel changed the title consumeWith: propagate consumed flag it was set consumeWith: propagate consumed flag when it was set Mar 1, 2025
@jamesdbrock
Copy link
Member

Thanks for the PR! Sorry for the review delay.

I'm reading now... it looks like this PR implements the suggestion from @natefaubion here #235 (comment)

@jamesdbrock jamesdbrock merged commit 145c543 into purescript-contrib:main Mar 6, 2025
1 check passed
@natefaubion natefaubion mentioned this pull request Mar 6, 2025
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

optionMaybe doesn't propagate fail when used whiteSpace
2 participants