Skip to content
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

instances for Down from Data.Ord? #347

Open
imuli opened this issue Dec 7, 2022 · 0 comments · May be fixed by #372
Open

instances for Down from Data.Ord? #347

imuli opened this issue Dec 7, 2022 · 0 comments · May be fixed by #372

Comments

@imuli
Copy link

imuli commented Dec 7, 2022

I occasionally run into cases where I want to use Down in a data type, use some generic derivation for Arbitrary, and end up needing to write the orphan instances (or make my own type for it):

deriving instance Arbitrary a => Arbitrary (Down a)
instance Arbitrary1 Down where
  liftArbitrary = fmap Down
  liftShrink shr = fmap Down . shr . getDown

It's not that big of a deal (and I admittedly rarely use the Arbitrary1 instance) but it would be nice if these were included, as they are for most other types in base.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants