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

Shrink floating binary point types similar to the Haskell version #103

Merged
merged 1 commit into from
May 27, 2017
Merged

Shrink floating binary point types similar to the Haskell version #103

merged 1 commit into from
May 27, 2017

Conversation

moodmosaic
Copy link
Member

Based on Hedgehog 0.2.2 Shrink.hs module's towardsFloat.

@moodmosaic moodmosaic requested a review from jacobstanley May 26, 2017 12:45
@@ -409,7 +409,7 @@ module Gen =

/// Generates a random 64-bit floating point number.
let double : Gen<double> =
create Shrink.double Random.sizedDouble
create (Shrink.towardsDouble 0.0) Random.sizedDouble
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that at some point we need to change Gen.double so that it takes a Range, similar to the other primitive combinators. I'd prefer to do this on a separate PR because Random.sizedDouble must be changed too and Seed.nextDouble must be added first. (Same also for Gen.float.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@moodmosaic
Copy link
Member Author

Range is in line with the Haskell version, and with this PR Shrink too. Next is Random, Seed, and Gen, not necessarily in this order 😃

@jacobstanley
Copy link
Member

Nice 👍

@jacobstanley jacobstanley merged commit fc96e9b into hedgehogqa:master May 27, 2017
@moodmosaic moodmosaic deleted the topic/shrink-towards-double branch May 27, 2017 13:30
@ghost ghost added this to the 0.3.0 milestone Sep 22, 2021
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