quickcheck
quickcheck copied to clipboard
instance Monoid Property
This Issue is complete once the library includes these instances.
instance Monoid Property where mempty = property True
instance Semigroup Property where (<>) = (.&&.)
I'm presuming that conjunction is the most useful and unsurprising monoidal semantics.
I think even just closing this Issue with an explanation for why we don't want this instance would also be quite useful as documentation. Thanks.
(I was surprised that I could not find a pre-existing Issue for this -- I apologize if I just missed it. I was also surprised to not find discussions of this elsewhere; it seemed like "QuickCheck
properties of monoids" was masking all my searches.)
For the record, I am in favour of (<>) = (.&&.)
as the least surprising choice. Another option is having newtypes like All a
and Any a
that are Testable
if a
is Testable
. That way nobody would be upset by the choice and the choice of instance would be crystal clear.