haskell / aeson

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

Improve `Arbitrary Value` instance. #1038

Closed phadej closed 1 year ago

phadej commented 1 year 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.

--

This is rebased #981, therefore closes #981.