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.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
(lcm
a b</>
a)
isJust
(lcm
a b</>
b)
Uniqueness
all
isJust
[ c</>
a , c</>
b ,lcm
a b</>
c ] ==> (lcm
a b==
c)
Idempotence
lcm
a a==
a
Identity
lcm
mempty
a==
a
lcm
amempty
==
a
Commutativity
lcm
a b==
lcm
b a
Associativity
lcm
(lcm
a b) c==
lcm
a (lcm
b c)
Absorption
lcm
a (gcd
a b)==
a
gcd
a (lcm
a 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<>
lcm
b c
Right-distributivity
lcm
(a<>
c) (b<>
c)==
lcm
a b<>
c
Lattice distributivity
lcm
a (gcd
b c)==
gcd
(lcm
a b) (lcm
a c)
gcd
a (lcm
b c)==
lcm
(gcd
a b) (gcd
a c)
Note that the following superclass laws are not included: