Copyright | © 2022 Jonathan Knowles |
---|---|
License | Apache-2.0 |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This module provides Laws
definitions for classes exported by
Data.Monoid.GCD.
Synopsis
- gcdMonoidLaws :: forall a. (Arbitrary a, Show a, Eq a, GCDMonoid a) => Proxy a -> Laws
- cancellativeGCDMonoidLaws :: forall a. (Arbitrary a, Show a, Eq a, Cancellative a, GCDMonoid a) => Proxy a -> Laws
- leftGCDMonoidLaws :: forall a. (Arbitrary a, Show a, Eq a, LeftGCDMonoid a) => Proxy a -> Laws
- rightGCDMonoidLaws :: forall a. (Arbitrary a, Show a, Eq a, RightGCDMonoid a) => Proxy a -> Laws
- overlappingGCDMonoidLaws :: forall a. (Arbitrary a, Show a, Eq a, OverlappingGCDMonoid a) => Proxy a -> Laws
Documentation
gcdMonoidLaws :: forall a. (Arbitrary a, Show a, Eq a, GCDMonoid a) => Proxy a -> Laws Source #
cancellativeGCDMonoidLaws :: forall a. (Arbitrary a, Show a, Eq a, Cancellative a, GCDMonoid a) => Proxy a -> Laws Source #
leftGCDMonoidLaws :: forall a. (Arbitrary a, Show a, Eq a, LeftGCDMonoid a) => Proxy a -> Laws Source #
Laws
for instances of LeftGCDMonoid
.
Tests the following laws:
stripCommonPrefix
a b&
\(p, _, _) -> p==
commonPrefix
a b
stripCommonPrefix
a b&
\(p, x, _) -> p<>
x==
a
stripCommonPrefix
a b&
\(p, _, x) -> p<>
x==
b
stripCommonPrefix
a b&
\(p, x, _) ->Just
x==
stripPrefix
p a
stripCommonPrefix
a b&
\(p, _, x) ->Just
x==
stripPrefix
p b
Note that the following superclass laws are not included:
rightGCDMonoidLaws :: forall a. (Arbitrary a, Show a, Eq a, RightGCDMonoid a) => Proxy a -> Laws Source #
Laws
for instances of RightGCDMonoid
.
Tests the following laws:
stripCommonSuffix
a b&
\(_, _, s) -> s==
commonSuffix
a b
stripCommonSuffix
a b&
\(x, _, s) -> x<>
s==
a
stripCommonSuffix
a b&
\(_, x, s) -> x<>
s==
b
stripCommonSuffix
a b&
\(x, _, s) ->Just
x==
stripSuffix
s a
stripCommonSuffix
a b&
\(_, x, s) ->Just
x==
stripSuffix
s b
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
.
Tests 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: