QuickCheck-2.14.3: Automatic testing of Haskell programs

Safe Haskell | Safe
Language | Haskell2010

Test.QuickCheck.Poly

Description

Types to help with testing polymorphic properties.

Types `A`, `B` and `C` are `newtype` wrappers around `Integer` that implement `Eq`, `Show`, `Arbitrary` and `CoArbitrary`. Types `OrdA`, `OrdB` and `OrdC` also implement `Ord` and `Num`.

See also Test.QuickCheck.All for an automatic way of testing polymorphic properties.

# Documentation

newtype A #

Constructors

A |

Fields

- unA :: Integer

#### Instances

Instances details

Arbitrary A # |
Instance details Defined in Test.QuickCheck.Poly Methods arbitrary :: Gen A # shrink :: A -> [A] #
CoArbitrary A # |
Instance details Defined in Test.QuickCheck.Poly Methods coarbitrary :: A -> Gen b -> Gen b #
Function A # |
Instance details Defined in Test.QuickCheck.Function Methods function :: (A -> b) -> A :-> b #
Show A # |
Instance details Defined in Test.QuickCheck.Poly Methods showsPrec :: Int -> A -> ShowS show :: A -> String showList :: [A] -> ShowS
Eq A # |
Instance details Defined in Test.QuickCheck.Poly Methods (==) :: A -> A -> Bool (/=) :: A -> A -> Bool

newtype B #

Constructors

B |

Fields

- unB :: Integer

#### Instances

Instances details

Arbitrary B # |
Instance details Defined in Test.QuickCheck.Poly Methods arbitrary :: Gen B # shrink :: B -> [B] #
CoArbitrary B # |
Instance details Defined in Test.QuickCheck.Poly Methods coarbitrary :: B -> Gen b -> Gen b #
Function B # |
Instance details Defined in Test.QuickCheck.Function Methods function :: (B -> b) -> B :-> b #
Show B # |
Instance details Defined in Test.QuickCheck.Poly Methods showsPrec :: Int -> B -> ShowS show :: B -> String showList :: [B] -> ShowS
Eq B # |
Instance details Defined in Test.QuickCheck.Poly Methods (==) :: B -> B -> Bool (/=) :: B -> B -> Bool

newtype C #

Constructors

C |

Fields

- unC :: Integer

#### Instances

Instances details

Arbitrary C # |
Instance details Defined in Test.QuickCheck.Poly Methods arbitrary :: Gen C # shrink :: C -> [C] #
CoArbitrary C # |
Instance details Defined in Test.QuickCheck.Poly Methods coarbitrary :: C -> Gen b -> Gen b #
Function C # |
Instance details Defined in Test.QuickCheck.Function Methods function :: (C -> b) -> C :-> b #
Show C # |
Instance details Defined in Test.QuickCheck.Poly Methods showsPrec :: Int -> C -> ShowS show :: C -> String showList :: [C] -> ShowS
Eq C # |
Instance details Defined in Test.QuickCheck.Poly Methods (==) :: C -> C -> Bool (/=) :: C -> C -> Bool

newtype OrdA #

Constructors

OrdA |

Fields

- unOrdA :: Integer

#### Instances

Instances details

Arbitrary OrdA # |
Instance details Defined in Test.QuickCheck.Poly Methods arbitrary :: Gen OrdA # shrink :: OrdA -> [OrdA] #
CoArbitrary OrdA # |
Instance details Defined in Test.QuickCheck.Poly Methods coarbitrary :: OrdA -> Gen b -> Gen b #
Function OrdA # |
Instance details Defined in Test.QuickCheck.Function Methods function :: (OrdA -> b) -> OrdA :-> b #
Num OrdA # |
Instance details Defined in Test.QuickCheck.Poly Methods (+) :: OrdA -> OrdA -> OrdA (-) :: OrdA -> OrdA -> OrdA (*) :: OrdA -> OrdA -> OrdA negate :: OrdA -> OrdA abs :: OrdA -> OrdA signum :: OrdA -> OrdA fromInteger :: Integer -> OrdA
Show OrdA # |
Instance details Defined in Test.QuickCheck.Poly Methods showsPrec :: Int -> OrdA -> ShowS show :: OrdA -> String showList :: [OrdA] -> ShowS
Eq OrdA # |
Instance details Defined in Test.QuickCheck.Poly Methods (==) :: OrdA -> OrdA -> Bool (/=) :: OrdA -> OrdA -> Bool
Ord OrdA # |
Instance details Defined in Test.QuickCheck.Poly Methods compare :: OrdA -> OrdA -> Ordering (<) :: OrdA -> OrdA -> Bool (<=) :: OrdA -> OrdA -> Bool (>) :: OrdA -> OrdA -> Bool (>=) :: OrdA -> OrdA -> Bool max :: OrdA -> OrdA -> OrdA min :: OrdA -> OrdA -> OrdA

newtype OrdB #

Constructors

OrdB |

Fields

- unOrdB :: Integer

#### Instances

Instances details

Arbitrary OrdB # |
Instance details Defined in Test.QuickCheck.Poly Methods arbitrary :: Gen OrdB # shrink :: OrdB -> [OrdB] #
CoArbitrary OrdB # |
Instance details Defined in Test.QuickCheck.Poly Methods coarbitrary :: OrdB -> Gen b -> Gen b #
Function OrdB # |
Instance details Defined in Test.QuickCheck.Function Methods function :: (OrdB -> b) -> OrdB :-> b #
Num OrdB # |
Instance details Defined in Test.QuickCheck.Poly Methods (+) :: OrdB -> OrdB -> OrdB (-) :: OrdB -> OrdB -> OrdB (*) :: OrdB -> OrdB -> OrdB negate :: OrdB -> OrdB abs :: OrdB -> OrdB signum :: OrdB -> OrdB fromInteger :: Integer -> OrdB
Show OrdB # |
Instance details Defined in Test.QuickCheck.Poly Methods showsPrec :: Int -> OrdB -> ShowS show :: OrdB -> String showList :: [OrdB] -> ShowS
Eq OrdB # |
Instance details Defined in Test.QuickCheck.Poly Methods (==) :: OrdB -> OrdB -> Bool (/=) :: OrdB -> OrdB -> Bool
Ord OrdB # |
Instance details Defined in Test.QuickCheck.Poly Methods compare :: OrdB -> OrdB -> Ordering (<) :: OrdB -> OrdB -> Bool (<=) :: OrdB -> OrdB -> Bool (>) :: OrdB -> OrdB -> Bool (>=) :: OrdB -> OrdB -> Bool max :: OrdB -> OrdB -> OrdB min :: OrdB -> OrdB -> OrdB

newtype OrdC #

Constructors

OrdC |

Fields

- unOrdC :: Integer

#### Instances

Instances details

Arbitrary OrdC # |
Instance details Defined in Test.QuickCheck.Poly Methods arbitrary :: Gen OrdC # shrink :: OrdC -> [OrdC] #
CoArbitrary OrdC # |
Instance details Defined in Test.QuickCheck.Poly Methods coarbitrary :: OrdC -> Gen b -> Gen b #
Function OrdC # |
Instance details Defined in Test.QuickCheck.Function Methods function :: (OrdC -> b) -> OrdC :-> b #
Num OrdC # |
Instance details Defined in Test.QuickCheck.Poly Methods (+) :: OrdC -> OrdC -> OrdC (-) :: OrdC -> OrdC -> OrdC (*) :: OrdC -> OrdC -> OrdC negate :: OrdC -> OrdC abs :: OrdC -> OrdC signum :: OrdC -> OrdC fromInteger :: Integer -> OrdC
Show OrdC # |
Instance details Defined in Test.QuickCheck.Poly Methods showsPrec :: Int -> OrdC -> ShowS show :: OrdC -> String showList :: [OrdC] -> ShowS
Eq OrdC # |
Instance details Defined in Test.QuickCheck.Poly Methods (==) :: OrdC -> OrdC -> Bool (/=) :: OrdC -> OrdC -> Bool
Ord OrdC # |
Instance details Defined in Test.QuickCheck.Poly Methods compare :: OrdC -> OrdC -> Ordering (<) :: OrdC -> OrdC -> Bool (<=) :: OrdC -> OrdC -> Bool (>) :: OrdC -> OrdC -> Bool (>=) :: OrdC -> OrdC -> Bool max :: OrdC -> OrdC -> OrdC min :: OrdC -> OrdC -> OrdC