genvalidity-property-1.0.0.0: Standard properties for functions on `Validity` types

Safe Haskell | None
Language | Haskell2010

Test.Validity.Operations.Commutativity

Synopsis

- commutativeOnGens :: (Show a, Show b, Eq b) => (a -> a -> b) -> Gen (a, a) -> ((a, a) -> [(a, a)]) -> Property
- commutative :: (Show a, Show b, Eq b, GenValid a) => (a -> a -> b) -> Property
- commutativeOnArbitrary :: (Show a, Show b, Eq b, Arbitrary a) => (a -> a -> b) -> Property

# Documentation

commutativeOnGens :: (Show a, Show b, Eq b) => (a -> a -> b) -> Gen (a, a) -> ((a, a) -> [(a, a)]) -> Property Source #

\[ Commutative(\star) \quad\equiv\quad \forall a, b: a \star b = b \star a \]

commutative :: (Show a, Show b, Eq b, GenValid a) => (a -> a -> b) -> Property Source #

    commutative ((+) :: Int -> Int -> Int)

    commutative ((*) :: Int -> Int -> Int)

commutativeOnArbitrary :: (Show a, Show b, Eq b, Arbitrary a) => (a -> a -> b) -> Property Source #

    commutativeOnArbitrary ((+) :: Int -> Int -> Int)

    commutativeOnArbitrary ((*) :: Int -> Int -> Int)

commutativeOnArbitrary :: (Show a, Eq a, Arbitrary a) => (a -> a -> a) -> Property