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

Add Semigroup, Monoid, and HeytingAlgebra instances to Result #101

Closed
wants to merge 1 commit into from

Conversation

np
Copy link

@np np commented Apr 8, 2019

In particular this fixes #96.
The HeytingAlgebra is useful when using Data.Foldable.{all,any}.

@hdgarrood
Copy link
Contributor

The behaviour provided by this HeytingAlgebra instance is of course useful but it's not a law-abiding instance, unfortunately. For instance, conj and disj are required to be commutative but they're not here, and also, if both a and b are failures, then a || (a && b) will produce a much more verbose error than a; however the HeytingAlgebra laws require that a || (a && b) = a.

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.

Semigroup Result instance?
2 participants