purescript / purescript-quickcheck

An implementation of QuickCheck in PureScript
BSD 3-Clause "New" or "Revised" License
104 stars 41 forks source link

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

Closed np closed 4 years ago

np commented 5 years ago

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

hdgarrood commented 5 years ago

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.