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

Use Cogen for function-like type Arbitrary instances #1605

Closed
ceedubs opened this issue Apr 17, 2017 · 1 comment
Closed

Use Cogen for function-like type Arbitrary instances #1605

ceedubs opened this issue Apr 17, 2017 · 1 comment
Assignees

Comments

@ceedubs
Copy link
Contributor

ceedubs commented Apr 17, 2017

Currently the Arbitrary instances for certain function-like types (such as Kleisli) just ignore the input and return a static value. Instead, they should probably require a Cogen for the input type so that they can "perturb" the output based on the input type.

@ceedubs ceedubs self-assigned this Apr 17, 2017
@ceedubs
Copy link
Contributor Author

ceedubs commented Apr 17, 2017

I can start taking a look at this.

ceedubs added a commit to ceedubs/cats that referenced this issue Apr 17, 2017
I think that this resolves typelevel#1605. It may have merge conflicts with typelevel#1584
and I think that one should probably be merged first.

I noticed a slight discrepancy between how I've implemented this (taking
implicit `Cogen` and `Arbitrary` instances) vs how the current `StateT`
arbitrary instance works (it takes an implicit `Arbitrary[S => F[(S, A)]]]). I'm not really sure whether one approach is better than the other. We should probably align on one of the two, though.
ceedubs added a commit to ceedubs/cats that referenced this issue Apr 21, 2017
ceedubs added a commit to ceedubs/cats that referenced this issue May 13, 2017
Resolves typelevel#1605.

This is a replacement for typelevel#1619. The approach taken in that PR led to
implicit resolution failures in scala.js.
kailuowang pushed a commit that referenced this issue May 15, 2017
Resolves #1605.

This is a replacement for #1619. The approach taken in that PR led to
implicit resolution failures in scala.js.
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