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 missing result combinators #308

Merged
merged 9 commits into from
Jan 4, 2025
Merged

Conversation

jmid
Copy link
Collaborator

@jmid jmid commented Jan 3, 2025

Fixes #303

This PR adds result combinators to

  • QCheck as an arbitrary
  • QCheck.{Gen,Print,Shrink,Observable}, and
  • QCheck2.{Gen,Print,Observable}.

Shrinking-wise they just reduce within Ok _ and Error _ without attempting to reduce one to the other.

Edit:
Ratio-wise, I've gone with 75% in favor of generating Ok _ - compared to option's 85% preference for Some _,
from the rationale that Ok _ is the preferred and expected path/value, but with a greater chance of Error _ since its constructor is more expressive than None and hence should be exercised more.

@jmid jmid merged commit 613828c into c-cube:main Jan 4, 2025
13 checks passed
@jmid jmid deleted the add-result-combinators branch January 4, 2025 15:03
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.

Missing result combinator
1 participant