Standard test spec for properties of Monad instances for values generated with GenValid instances
Example usage:
monadSpec @[]:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27
Modulegenvalidity-hspec-1.0.0.4Haskell2010
Monad properties
You will need TypeApplications to use these.
Standard test spec for properties of Monad instances for values generated with GenValid instances
Example usage:
monadSpec @[]monadSpecOnArbitrary :: (Eq (f Int), Show (f Int), Monad f, Typeable f, Arbitrary (f Int)) => SpecStandard test spec for properties of Monad instances for values generated with Arbitrary instances
Example usage:
monadSpecOnArbitrary @[]Standard test spec for properties of Monad instances for values generated by given generators (and names for those generator).
Example usage:
monadSpecOnGens
@[]
@Int
(pure 4)
"four"
(genListOf $ pure 5)
"list of fives"
(genListOf $ pure 6)
"list of sixes"
((*) <$> genValid)
"factorisations"
(pure $ \a -> [a])
"singletonisation"
(pure $ \a -> [a])
"singletonisation"
(pure $ pure (+ 1))
"increment in list"