Copyright | © 2022–2024 Jonathan Knowles |
---|---|
License | Apache-2.0 |
Safe Haskell | None |
Language | Haskell2010 |
This module provides Laws
definitions for classes exported by
Data.Group.
Group
groupLaws :: (Arbitrary a, Show a, Eq a, Group a) => Proxy a -> Laws Source #
Includes the following laws:
Inversion
invert
mempty
==
mempty
invert
(invert
a)==
a
a<>
invert
a==
mempty
invert
a<>
a==
mempty
Subtraction
a~~
mempty
==
a
a~~
a==
mempty
a~~
b==
a<>
invert
b
Exponentiation
pow
a 0==
mempty
n>=
0 ==>pow
a n==
mconcat
(replicate
n a) n<=
0 ==>pow
a n==
invert
(mconcat
(replicate
(abs
n) a))
Superclass laws
Note that the following superclass laws are not included: