QuickCheck-2.15.0.1: 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 Source #

Constructors

A |

Fields

- unA :: Integer

#### Instances

Instances details

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

newtype B Source #

Constructors

B |

Fields

- unB :: Integer

#### Instances

Instances details

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

newtype C Source #

Constructors

C |

Fields

- unC :: Integer

#### Instances

Instances details

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

newtype OrdA Source #

Constructors

OrdA |

Fields

- unOrdA :: Integer

#### Instances

Instances details

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

newtype OrdB Source #

Constructors

OrdB |

Fields

- unOrdB :: Integer

#### Instances

Instances details

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

newtype OrdC Source #

Constructors

OrdC |

Fields

- unOrdC :: Integer

#### Instances

Instances details

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