hedgehogqa / hedgehogqa/fsharp-hedgehog

Replace `BigInt` with a native type

Open
#371 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
F#
Stars
284
Forks
31
PR merge metrics
No merged PRs in 30d

Description

Our use of `BigInt` internally is the cause of some slowness, and I've shown in https://github.com/hedgehogqa/fsharp-hedgehog/issues/135#issuecomment-925136736 that by replacing it we can get immediate efficiency improvements. This however can't be done naively, so we'll need to consider how we support generation of `uint64`, `int64`, `double`, and `bigint` with a different internal type.

Something we may want to consider is grouping numeric types into a few categories:

- Signed integers (`int8`, `int16`, `int32`, `int64`)
- Unsigned integers (`uint8`, `uint16`, `uint32`, `uint64`)
- Floating point numbers (`single`, `double`)

Then we can have one `integral` function for each category that uses the largest number in its category to generate from. This would help us avoid weird conversion issues and allow us to drop `BigInt` internally.

I do, however, think we should add a `Gen.bigint` function. But that is outside the scope of this issue, and should be considered on its own merit.

Thoughts?

/cc @TysonMN @dharmaturtle @moodmosaic

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.