Copyright | © 2022–2024 Jonathan Knowles |
---|---|
License | Apache-2.0 |
Safe Haskell | None |
Language | Haskell2010 |
This module provides Laws
definitions for classes exported by
Data.Semigroup.Cancellative.
Synopsis
- commutativeLaws :: (Arbitrary a, Show a, Eq a, Commutative a) => Proxy a -> Laws
- reductiveLaws :: (Arbitrary a, Show a, Eq a, Reductive a) => Proxy a -> Laws
- leftReductiveLaws :: (Arbitrary a, Show a, Eq a, LeftReductive a) => Proxy a -> Laws
- rightReductiveLaws :: (Arbitrary a, Show a, Eq a, RightReductive a) => Proxy a -> Laws
- cancellativeLaws :: (Arbitrary a, Show a, Eq a, Cancellative a) => Proxy a -> Laws
- leftCancellativeLaws :: (Arbitrary a, Show a, Eq a, LeftCancellative a) => Proxy a -> Laws
- rightCancellativeLaws :: (Arbitrary a, Show a, Eq a, RightCancellative a) => Proxy a -> Laws
Commutative
commutativeLaws :: (Arbitrary a, Show a, Eq a, Commutative a) => Proxy a -> Laws Source #
Laws
for instances of Commutative
.
Includes the following law:
a<>
b==
b<>
a
Note that the following superclass laws are not included:
Reductive
reductiveLaws :: (Arbitrary a, Show a, Eq a, Reductive a) => Proxy a -> Laws Source #
leftReductiveLaws :: (Arbitrary a, Show a, Eq a, LeftReductive a) => Proxy a -> Laws Source #
Laws
for instances of LeftReductive
.
Includes the following laws:
a`isPrefixOf`
(a<>
b)
isPrefixOf
a b==
isJust
(stripPrefix
a b)
maybe
b (a<>
) (stripPrefix
a b)==
b
Note that the following superclass laws are not included:
rightReductiveLaws :: (Arbitrary a, Show a, Eq a, RightReductive a) => Proxy a -> Laws Source #
Laws
for instances of RightReductive
.
Includes the following laws:
b`isSuffixOf`
(a<>
b)
isSuffixOf
a b==
isJust
(stripSuffix
a b)
maybe
b (<>
a) (stripSuffix
a b)==
b
Note that the following superclass laws are not included:
Cancellative
cancellativeLaws :: (Arbitrary a, Show a, Eq a, Cancellative a) => Proxy a -> Laws Source #
leftCancellativeLaws :: (Arbitrary a, Show a, Eq a, LeftCancellative a) => Proxy a -> Laws Source #
Laws
for instances of LeftCancellative
.
Includes the following law:
stripPrefix
a (a<>
b)==
Just
b
Note that the following superclass laws are not included:
rightCancellativeLaws :: (Arbitrary a, Show a, Eq a, RightCancellative a) => Proxy a -> Laws Source #
Laws
for instances of RightCancellative
.
Includes the following law:
stripSuffix
b (a<>
b)==
Just
a
Note that the following superclass laws are not included: