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 Kleisli and Func Arbitrary instances #1606

Closed
wants to merge 1 commit into from

Conversation

ceedubs
Copy link
Contributor

@ceedubs ceedubs commented Apr 17, 2017

I think that this resolves #1605. It may have merge conflicts with #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.

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.
Copy link
Contributor

@edmundnoble edmundnoble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you are correct in your assessment of the necessity to standardise, and I think the best solution is to standardise on taking in the Arbitrary specialised to the function instance (as done with StateT). It's more flexible; just in case you do want any constant functions you can provide them via an Arbitrary function instance, because we avoid baking in the in-built Arbitrary function instances.

@ceedubs
Copy link
Contributor Author

ceedubs commented Apr 21, 2017

Thanks for the feedback @edmundnoble. I'm going to go ahead and close out this PR and open a new one that uses the approach that you suggested and that doesn't have merge conflicts.

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

Successfully merging this pull request may close these issues.

Use Cogen for function-like type Arbitrary instances
2 participants