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

Untested CoflatMap laws #732

Closed
ceedubs opened this issue Dec 9, 2015 · 1 comment · Fixed by #733
Closed

Untested CoflatMap laws #732

ceedubs opened this issue Dec 9, 2015 · 1 comment · Fixed by #733

Comments

@ceedubs
Copy link
Contributor

ceedubs commented Dec 9, 2015

There are several laws defined in CoflatMapLaws that aren't checked in CoflatMapTests. It looks like they require some additional Eq instances, but other than that I'm not sure whether or not there is a good reason they aren't currently included. Does anyone know?

Paging @fthomas and @non due to git history :)

@fthomas
Copy link
Member

fthomas commented Dec 9, 2015

That is the associativity law of coflatMap expressed in terms of Cokleisli composition. There is also a law that shows the associativity of Kleisli composition in FlatMapLaws. I've added them because the associativity is more apparent in this formulation (see also this Gitter discussion).

Since those laws are more or less duplicates of existing laws, I'd just test them with a single type so that code coverage do not mark them as unused. If they pass for one type, I guess the other tests and laws guarantee that they also pass for all other types.

I'll try to come up with test for those.

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.

3 participants