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

Semiring Maybe instance is badly behaved #18

Closed
hdgarrood opened this issue Nov 16, 2015 · 0 comments
Closed

Semiring Maybe instance is badly behaved #18

hdgarrood opened this issue Nov 16, 2015 · 0 comments

Comments

@hdgarrood
Copy link
Contributor

Semiring has the following law:

  • zero * a = zero

With the instance (Semiring a) => Semiring (Maybe a), neither of these hold for a = Nothing - since mul is defined as liftA2 mul, zero * Nothing = Nothing, but zero = Just zero. Changing the definition of zero to be Nothing could fix this but might break other laws, I'm not sure. Maybe we should just remove this instance.

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

1 participant