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

Improve choose[BigInt] #664

Closed
ashawley opened this issue May 26, 2020 · 0 comments
Closed

Improve choose[BigInt] #664

ashawley opened this issue May 26, 2020 · 0 comments
Milestone

Comments

@ashawley
Copy link
Contributor

Gen.choose[BigInt] was added in #636 by @dmurvihill. In a comment, Erik shared some code that could improve its performance.

@ashawley ashawley added this to the 1.15.0 milestone Jun 4, 2020
non added a commit to non/scalacheck that referenced this issue Jul 1, 2020
In addition to implicit Choose instances for scala.math.BigDecimal and
java.math.BigDecimal we also include explicit constructor methods, since users
may wish to be explicit about the scale they want. We may want to put those
methods directly on Gen, currently the ergonomics of using this are a bit bad:

    Gen.Choose.chooseBigDecimalScale(100).choose(0, 1)

The BigDecimal generation is not yet tested. That will also be added in a
follow up. This also optimizes the BigInt generator a bit and generalizes it to
java.math.BigInteger to support that as well.

Addresses typelevel#631, typelevel#637, and typelevel#664
@larsrh larsrh closed this as completed Oct 24, 2020
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

No branches or pull requests

2 participants