| Copyright | © 2022–2025 Jonathan Knowles |
|---|---|
| License | Apache-2.0 |
| Safe Haskell | None |
| Language | Haskell2010 |
Test.QuickCheck.Classes.Monoid.LCM
Description
This module provides Laws definitions for classes exported by
Data.Monoid.LCM.
Synopsis
- lcmMonoidLaws :: (Arbitrary a, Show a, Eq a, LCMMonoid a) => Proxy a -> Laws
- distributiveLCMMonoidLaws :: (Arbitrary a, Show a, Eq a, DistributiveLCMMonoid a) => Proxy a -> Laws
Documentation
lcmMonoidLaws :: (Arbitrary a, Show a, Eq a, LCMMonoid a) => Proxy a -> Laws Source #
Laws for instances of LCMMonoid.
Includes the following laws:
Reductivity
isJust(lcma b</>a)
isJust(lcma b</>b)
Uniqueness
allisJust[ c</>a , c</>b ,lcma b</>c ] ==> (lcma b==c)
Idempotence
lcma a==a
Identity
lcmmemptya==a
lcmamempty==a
Commutativity
lcma b==lcmb a
Associativity
lcm(lcma b) c==lcma (lcmb c)
Absorption
lcma (gcda b)==a
gcda (lcma b)==a
Note that the following superclass laws are not included:
distributiveLCMMonoidLaws :: (Arbitrary a, Show a, Eq a, DistributiveLCMMonoid a) => Proxy a -> Laws Source #
Laws for instances of DistributiveLCMMonoid.
Includes the following laws:
Left-distributivity
lcm(a<>b) (a<>c)==a<>lcmb c
Right-distributivity
lcm(a<>c) (b<>c)==lcma b<>c
Lattice distributivity
lcma (gcdb c)==gcd(lcma b) (lcma c)
gcda (lcmb c)==lcm(gcda b) (gcda c)
Note that the following superclass laws are not included: