haskell / aeson

A fast Haskell JSON library
Other
1.26k stars 321 forks source link

Improve `Arbitrary` instance. #981

Closed ChickenProp closed 1 year ago

ChickenProp commented 2 years ago

Fixes #980. As discussed there, simply changing n <= 0 to n <= 1 gives good generation of strings, bools, numbers and null. Turns out it also forbids [] and {} from being generated, so I added those explicitly to that case.

My understanding is this requires a major version bump, as a change in behavior of an exported function.

phadej commented 2 years ago

Looks good indeed, Yet I'll write some tests to we can actually claim anything about quality of generated values.