quickcheck-monoid-subclasses-0.2.0.0: Testing monoid subclass instances with QuickCheck
Copyright© 2022–2023 Jonathan Knowles
LicenseApache-2.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.QuickCheck.Classes.Monoid.Monus

Description

This module provides Laws definitions for classes exported by Data.Monoid.Monus.

Synopsis

Documentation

monusLaws :: forall a. (Arbitrary a, Show a, Eq a, Monus a) => Proxy a -> Laws Source #

Laws for instances of Monus.

Includes the following laws:

a <\> a == mempty
mempty <\> a == mempty
a <> (b <\> a) == b <> (a <\> b)
(a <\> b) <\> c == a <\> (b <> c)
a <\> b == stripPrefixOverlap b a
a <\> b == stripSuffixOverlap b a

Note that the following superclass laws are not included:

overlappingGCDMonoidLaws :: forall a. (Arbitrary a, Show a, Eq a, OverlappingGCDMonoid a) => Proxy a -> Laws Source #

Laws for instances of OverlappingGCDMonoid.

Includes the following laws:

overlap a b <> stripPrefixOverlap a b == b
stripSuffixOverlap b a <> overlap a b == a
stripOverlap a b & \(_, x, _) -> x == overlap a b
stripOverlap a b & \(_, _, x) -> x == stripPrefixOverlap a b
stripOverlap a b & \(x, _, _) -> x == stripSuffixOverlap b a

Note that the following superclass laws are not included: