smallcheck-laws-0.2: SmallCheck properties for common laws

Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.SmallCheck.Laws.Monoid

Contents

Synopsis

Monoid laws

leftIdentity :: (Eq a, Monad m, Show a, Monoid a) => Series m a -> Property m Source

Check the left identity law hold for the given Monoid Series:

mempty <> x ≡ x

rightIdentity :: (Eq a, Monad m, Show a, Monoid a) => Series m a -> Property m Source

Check the right identity law hold for the given Monoid Series:

x <> mempty ≡ x

associativity :: (Eq a, Monad m, Show a, Monoid a) => Series m a -> Series m a -> Series m a -> Property m Source

Check the associativity law hold for the given Monoid Series:

x <> (y <> z) ≡ (x <> y) <> z

mconcat :: (Eq a, Monad m, Show a, Monoid a) => Series m a -> Property m Source

Check the mconcat law hold for the given Monoid Series:

mconcatfoldr mappend mempty