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

Safe HaskellSafe
LanguageHaskell98

Test.QuickCheck.Property.Generic

Contents

Description

Generic properties of functions

Synopsis

Documentation

General

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

Test that relation is reflective.

f x x = True

Monoids & group

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

Test that function is associative

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

Test that function is commutative

prop_LeftIdentity #

Arguments

:: a

Left identity

-> (a -> a -> a)

Associative operation

-> T a 
-> a 
-> Equal a 

Test that value is a left identity

prop_RightIdentity #

Arguments

:: a

Right identity

-> (a -> a -> a)

Associative operation

-> T a 
-> a 
-> Equal a 

Test that value is a left identity

prop_Identity #

Arguments

:: a

Identity element

-> (a -> a -> a)

Associative operation

-> T a 
-> a 
-> Equal a 

Test that value is both right and left identity

prop_GroupInverse #

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_GenMonoid #

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_Group #

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