-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Consider remove dependency on scalacheck from cats-laws #2800
Comments
I'm a weak 👎 on this, at least off the top of my head, since ScalaCheck has been around a lot longer than Cats, breaks bincompat very rarely and only for good reasons, and has trustworthy / present maintainers. Also my guess is that plumbing |
I'm in favor of this so I can use ScalaTest's generators/property testing.
I'd imagine other folks might want to use scalaprops or one of the other
newer property testing libraries.
…On Fri, Apr 19, 2019 at 12:19 PM Travis Brown ***@***.***> wrote:
I'm a weak 👎 on this, at least off the top of my head, since ScalaCheck
has been around a lot longer than Cats, breaks bincompat very rarely and
only for good reasons, and has trustworthy / present maintainers. Also my
guess is that plumbing Arbitrary and Shrink instances through this
abstraction everywhere will be kind of messy—if someone shows that it can
be done nicely I'd be happy to change my mind.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2800 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAA42PT6UXPPT437W5POOU3PRHWJPANCNFSM4HHE3WHQ>
.
|
Also in favor, if it doesn't complicate things too much. ScalaCheck isn't really state of the art anymore and it would be nice to open things up if we can. |
I added a proof of concept design, any thoughts? |
@kailuowang Looks reasonable to me (you'll need to add |
cc @larsrh, any thought? |
@kailuowang I have no opinion on this. |
We do law-checking and I would be fine with mechanical changes. Honestly it's so complicated to get everything set up I can't imagine many people are doing it. |
Consider abstract out the dependency on scalacheck from cats-laws with some intermediate type class. Then we can have a new module cats-testkit-scalacheck, which is more justfiable to have different versioning which could be more tied to Scalacheck breaking releases. In fact this approach may allow the community to push the dependency on scalacheck to where the tests run, rather than where the law is defined.
Update:
I created a proof of concept for this design in my mind, It compiles to show the type should work
First the usage API on the laws site
In this usage when user added a new law, the compiler will prompt on what
CheckX
instance is needed.Here is the law test site that is dependent on scalacheck
The
Check
is a type class that abstract out the operation that converts a defined lawA1 => IsEq[A2]
to a testable unified type PWe are going have to create multiple arity version of this type class
The simplified usage on the law site was enabled by the following DSL trait
apparently we need more arity versions.
On the test site we are going to provide the Checkable Instance for scalacheck derived from
Arbitrary
instances.The law definition usage site is quite different with a different set of evidences, but they are probably easier to understand, whatever you law's type is, you just add a corresponding Check[A, B, C] evidence, without the need to understand all the scalacheck types.
What do you guys think?
The text was updated successfully, but these errors were encountered: