| Copyright | © 2022–2025 Jonathan Knowles |
|---|---|
| License | Apache-2.0 |
| Safe Haskell | None |
| Language | Haskell2010 |
Test.QuickCheck.Classes.Semigroup.Cancellative
Contents
Description
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)
isPrefixOfa b==isJust(stripPrefixa b)
maybeb (a<>) (stripPrefixa 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)
isSuffixOfa b==isJust(stripSuffixa b)
maybeb (<>a) (stripSuffixa 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:
stripPrefixa (a<>b)==Justb
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:
stripSuffixb (a<>b)==Justa
Note that the following superclass laws are not included: