quickcheck-properties-0.1: QuickCheck properties for standard type classes.

Test.QuickCheck.Property.Generic

Contents

Description

Generic properties of functions

Synopsis

Documentation

General

prop_Reflexive :: (a -> a -> Bool) -> T a -> a -> BoolSource

Test that relation is reflective.

 f x x = True

Monoids & group

prop_Associative :: (a -> a -> a) -> T a -> a -> a -> a -> Equal aSource

Test that function is associative

prop_Commutative :: (a -> a -> b) -> T (a, b) -> a -> a -> Equal bSource

Test that function is commutative

prop_LeftIdentitySource

Arguments

:: a

Left identity

-> (a -> a -> a)

Associative operation

-> T a 
-> a 
-> Equal a 

Test that value is a left identity

prop_RightIdentitySource

Arguments

:: a

Right identity

-> (a -> a -> a)

Associative operation

-> T a 
-> a 
-> Equal a 

Test that value is a left identity

prop_IdentitySource

Arguments

:: a

Identity element

-> (a -> a -> a)

Associative operation

-> T a 
-> a 
-> Equal a 

Test that value is both right and left identity

prop_GroupInverseSource

Arguments

:: a

Identity element

-> (a -> a -> a)

Group operation

-> (a -> a)

Find inverse

-> T a 
-> a 
-> Equal a 

Test that inverse operation is correct.

General

prop_GenMonoidSource

Arguments

:: a

Identity element

-> (a -> a -> a)

Associative operation

-> T a 
-> a 
-> a 
-> a 
-> Equal a 

Test that identity and associative operation satisfy monoid laws.

prop_GroupSource

Arguments

:: a

Identity element

-> (a -> a -> a)

Associative operation

-> (a -> a)

Find inverse element

-> T a 
-> a 
-> a 
-> a 
-> Equal a 

Test that identity, associative operation and inverse satisfy group laws