Closed sjakobi closed 1 year ago
Maybe an implementation in terms of shrinkIntegral
would make sense. For a large type you possibly wouldn't want to shrink to all the smaller constructors, but shrinking to an "interesting" selection of them would be useful.
@sjakobi
I've created a PR that may resolve this issue here: https://github.com/nick8325/quickcheck/pull/350
Fixed by #350.
@sjakobi just in case you're still interested, the latest Hackage release has shrinkBoundedEnum
: 🎉
https://hackage.haskell.org/package/QuickCheck-2.14.3/docs/Test-QuickCheck.html#v:shrinkBoundedEnum
I have a small sum type that currently uses
genericShrink
:genericShrink
is useless in this case though, since there are no subterms that it could shrink to. From the haddocks:What I'd like to have is a function that shrinks a constructor to the "smaller" constructors, either
or
Could one of these functions (or a variation) be added as
shrinkBoundedEnum
in analogy toarbitraryBoundedEnum
?!