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

Typeclasses that ONLY define laws. #334

Closed
woparry opened this issue Jun 8, 2015 · 1 comment · Fixed by #1720
Closed

Typeclasses that ONLY define laws. #334

woparry opened this issue Jun 8, 2015 · 1 comment · Fixed by #1720
Assignees

Comments

@woparry
Copy link

woparry commented Jun 8, 2015

What do people think of adding typeclasses that only add new laws (ie. have no new functionality, but restrict which implementations are valid.)

I'm specifically thinking of something like CommutativeMonad, which would add a commutativity restriction to Monad (so that e.g. a distributive law can be derived which would allow composition, see #332 and the related discussion re: Traverse).

Since we have discipline, the extra laws can be checked by implementers fairly easily, and it opens up new avenues for writing slightly more general combinators in cats.

@ceedubs
Copy link
Contributor

ceedubs commented Jun 20, 2015

Sounds good to me.

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 a pull request may close this issue.

3 participants