-
Notifications
You must be signed in to change notification settings - Fork 119
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
shrinkBoundedEnum
?!
#343
Comments
Maybe an implementation in terms of |
Though the `QuickCheck` library provides a handy `arbitraryBoundedEnum` function, it currently doesn't provide a `shrinkBoundedEnum` counterpart. Users have asked for a function like this here: nick8325/quickcheck#343 This commit adds our own version, for now. Perhaps, later on, we can submit a PR to the `QuickCheck` repository to add this function, and delete our own version.
Though the `QuickCheck` library provides a handy `arbitraryBoundedEnum` function, it currently doesn't provide a `shrinkBoundedEnum` counterpart. Users have asked for a function like this here: nick8325/quickcheck#343 This commit adds our own version, for now. Perhaps, later on, we can submit a PR to the `QuickCheck` repository to add this function, and delete our own version.
Fixed by #350. |
@sjakobi just in case you're still interested, the latest Hackage release has 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
?!The text was updated successfully, but these errors were encountered: