-
Notifications
You must be signed in to change notification settings - Fork 25
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
Arbitrary instances for fixed-length vectors? #72
Comments
I'm going to defer to @expipiplus1 here, I think. But I'm somewhat slightly opposed to adding new deps that might incur other transient dependencies. For what it's worth, test suites are usually implemented by applications and standalone test executables, which negates most of the downsides of orphan instances. (The problems mostly arise if library code ever imports a module with orphans) So having this functionality as an orphan instance lib (or also as an orphan instance defined every time someone wants to test it) wouldn't be too bad, considering that the instance is relatively simple to write; it's just:
and any test suite or application that needs it can just drop those two lines (plus the |
@mstksg Yeah, I think I agree. Based on what you've said, I'll close this issue (and not attempt to PR this), unless @expipiplus1 indicates otherwise by reopening. |
Can we reopen? I think this would make a lot of sense to add this, guarded by a cabal flag. That way, there are no new dependencies by default, but people can easily get the instances without incurring orphan instances. |
@turion I think that could be OK. I wouldn't mind implementing that functionality, as long as @expipiplus1 OK's it. |
Yeah, definitely uncontroversial under a flag. How I wish Haskell had a better solution for this problem... |
Given that a fixed-length vector's size is... well, fixed, it makes
Arbitrary
instances very easy. This would also assist me greatly with writing QuickCheck tests forvector-sized-extra
, which I'd like to do before it hits Hackage.However, this will involve dragging QuickCheck in as a dependency, and I'm not sure if this is something we want. So, in short, is it?
The text was updated successfully, but these errors were encountered: