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

Misleading functions in clash-prelude-hedgehog #2138

Closed
martijnbastiaan opened this issue Mar 24, 2022 · 3 comments · Fixed by #2140
Closed

Misleading functions in clash-prelude-hedgehog #2138

martijnbastiaan opened this issue Mar 24, 2022 · 3 comments · Fixed by #2140
Labels
Milestone

Comments

@martijnbastiaan
Copy link
Member

E.g., genSigned can generate results outside of its given range:

genSigned :: (MonadGen m, KnownNat n) => Range (Signed n) -> m (Signed n)
genSigned range =
Gen.frequency
[ (60, Gen.integral range)
, (20, Gen.constant minBound)
, (20, Gen.constant maxBound)
]

I think this is misleading at best. We probably want to inspect the given range and generate its extreme values.

@alex-mckenna
Copy link
Contributor

Yes, that seems reasonable. Do you want to make a PR or should I, it's just a case of changing

minBound ~~> Range.lowerBound range
maxBound ~~> Range.upperBound range

@alex-mckenna alex-mckenna added this to the 1.6.3 milestone Mar 24, 2022
@martijnbastiaan
Copy link
Member Author

Go for it

@martijnbastiaan
Copy link
Member Author

We've released v1.6.3, which includes a fix for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants