-
Notifications
You must be signed in to change notification settings - Fork 18
Closed
Labels
type: enhancementA new feature or addition.A new feature or addition.
Description
It should be possible to support quickchecking laws without making use of Arbitrary
. Here is an example for Semigroup
:
checkSemigroupGen
∷ ∀ eff s
. Semigroup s
⇒ Eq s
⇒ Gen s
→ QC eff Unit
checkSemigroupGen gen = do
log "Checking 'Associativity' law for Semigroup"
quickCheck' 1000 $ associativity <$> gen <*> gen <*> gen
where
associativity ∷ s → s → s → Boolean
associativity x y z = ((x <> y) <> z) == (x <> (y <> z))
Metadata
Metadata
Assignees
Labels
type: enhancementA new feature or addition.A new feature or addition.