Copyright | © 2022–2024 Jonathan Knowles |
---|---|
License | Apache-2.0 |
Safe Haskell | None |
Language | Haskell2010 |
This module provides Laws
definitions for classes exported by
Data.Monoid.Monus.
Documentation
monusLaws :: (Arbitrary a, Show a, Eq a, Monus a) => Proxy a -> Laws Source #
overlappingGCDMonoidLaws :: (Arbitrary a, Show a, Eq a, OverlappingGCDMonoid a) => Proxy a -> Laws Source #
Laws
for instances of OverlappingGCDMonoid
.
Includes the following laws:
Reductivity
isJust
(stripSuffix
(overlap
a b) a)
isJust
(stripPrefix
(overlap
a b) b)
Idempotence
overlap
a a==
a
Identity
overlap
mempty
a==
mempty
overlap
amempty
==
mempty
Equivalences
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: