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

Consider adding instance MonoFunctor Set #176

Open
tysonzero opened this issue Jul 16, 2019 · 1 comment
Open

Consider adding instance MonoFunctor Set #176

tysonzero opened this issue Jul 16, 2019 · 1 comment

Comments

@tysonzero
Copy link

tysonzero commented Jul 16, 2019

Thus, even though a MonoFunctor instance for Set could theoretically be defined, it is omitted since it could violate the functor law of omap f . omap g = omap (f . g).

The current docs in Data.Eq specifies that Eq is expected to follow the substitutivity law (modulo private functions, such as showTree and friends), so this functor law could only be violated via an unlawful instance.

Since it is well established that laws are not expected to hold in the presence of law violating instances (Foldable for Set onto a non-associative Monoid violates laws for example), I think it's worth considering adding this instance.

@snoyberg
Copy link
Owner

I don't have any strong thoughts on this to be honest.

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

No branches or pull requests

2 participants