genvalidity-sydtest-0.0.0.0: Standard properties for functions on `Validity` types for the sydtest framework
Safe HaskellNone
LanguageHaskell2010

Test.Syd.Validity.Operations.Identity

Synopsis

Documentation

leftIdentityOnElemWithEquality Source #

Arguments

:: (b -> a -> a)

A binary operation

-> (a -> a -> Bool)

An equality

-> b

A candidate left-identity

-> a

An element

-> Bool 

\[ LeftIdentity(\star, \doteq, b) \quad\equiv\quad \forall a: (b \star a) \doteq a \]

leftIdentityOnGenWithEquality Source #

Arguments

:: Show a 
=> (b -> a -> a)

A binary operation

-> (a -> a -> Bool)

An equality

-> b

A candidate left-identity

-> Gen a 
-> (a -> [a]) 
-> Property 

leftIdentityOnGen Source #

Arguments

:: (Show a, Eq a) 
=> (b -> a -> a)

A binary operation

-> b

A candidate left-identity

-> Gen a 
-> (a -> [a]) 
-> Property 

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

leftIdentityOnValid (flip ((^) :: Rational -> Int -> Rational)) 1

leftIdentity :: (Show a, Eq a, GenUnchecked a) => (b -> a -> a) -> b -> Property Source #

leftIdentity (flip ((^) :: Int -> Int -> Int)) 1

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

leftIdentityOnArbitrary (flip ((^) :: Int -> Int -> Int)) 1

rightIdentityOnElemWithEquality Source #

Arguments

:: (a -> b -> a)

A binary operation

-> (a -> a -> Bool)

An equality

-> b

A candidate right-identity

-> a

An element

-> Bool 

\[ RightIdentity(\star, \doteq, b) \quad\equiv\quad \forall a: (a \star b) \doteq a \]

rightIdentityOnGenWithEquality Source #

Arguments

:: Show a 
=> (a -> b -> a)

A binary operation

-> (a -> a -> Bool)

An equality

-> b

A candidate right-identity

-> Gen a 
-> (a -> [a]) 
-> Property 

rightIdentityOnGen Source #

Arguments

:: (Show a, Eq a) 
=> (a -> b -> a)

A binary operation

-> b

A candidate right-identity

-> Gen a 
-> (a -> [a]) 
-> Property 

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

rightIdentityOnValid ((^) :: Rational -> Int -> Rational) 1

rightIdentity :: (Show a, Eq a, GenUnchecked a) => (a -> b -> a) -> b -> Property Source #

rightIdentity ((^) :: Int -> Int -> Int) 1

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

rightIdentityOnArbitrary ((^) :: Int -> Int -> Int) 1

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

\[ Identity(\star, \doteq, b) \quad\equiv\quad LeftIdentity(\star, \doteq, b) \wedge RightIdentity(\star, \doteq, b) \]

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

identityOnValid ((*) :: Rational -> Rational -> Rational) 1
identityOnValid ((+) :: Rational -> Rational -> Rational) 0

identity :: (Show a, Eq a, GenUnchecked a) => (a -> a -> a) -> a -> Property Source #

identity ((*) :: Int -> Int -> Int) 1
identity ((+) :: Int -> Int -> Int) 0

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

identityOnArbitrary ((*) :: Int -> Int -> Int) 1
identityOnArbitrary ((+) :: Int -> Int -> Int) 0