QuickCheckVariant-0.1.1.0: Generator of "valid" and "invalid" data in a type class

Copyright(c) Jorge Santiago Alvarez Cuadros, 2015
LicenseGPL-3
Maintainersanjorgek@ciencias.unam.mx
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

Test.QuickCheck.Variant

Description

To get random "invalid" and "valid" data

Synopsis

Documentation

class Variant a where Source #

You can define

>>> instance (Varaint a) => Arbitrary a where {arbitrary = oneof [valid, invalid]}

Minimal complete definition

valid, invalid

Methods

valid :: Gen a Source #

Get a generator of valid random data type

invalid :: Gen a Source #

Get a generator of invalid random data type

Instances

Variant a => Variant [a] Source #

Variant of a list.

A valid list only had valid data.

A invalid list had only invalid data or some valid data with invalid data.

Methods

valid :: Gen [a] Source #

invalid :: Gen [a] Source #

Variant a => Variant (Maybe a) Source #

Variant Maybe

Only Just data can be invalid, nothing always is valid.

Methods

valid :: Gen (Maybe a) Source #

invalid :: Gen (Maybe a) Source #

(Variant a, Variant b) => Variant (Either a b) Source #

Varaint Either.

Methods

valid :: Gen (Either a b) Source #

invalid :: Gen (Either a b) Source #

(Variant a, Variant b) => Variant (a, b) Source #

Varaint tuple

Invalid tuple may had some valid data with invalid data or only invalid data.

Valid tuple had only valid data.

Methods

valid :: Gen (a, b) Source #

invalid :: Gen (a, b) Source #

(Variant a, Variant b, Variant c) => Variant (a, b, c) Source #

Varaint 3-tuple

Invalid 3-tuple may had some valid data with invalid data or only invalid data.

Valid 3-tuple had only valid data.

Methods

valid :: Gen (a, b, c) Source #

invalid :: Gen (a, b, c) Source #

class VarTesteable prop where Source #

The class of things wich can be tested with invalid or valid input.

Minimal complete definition

propertyValid, propertyInvalid

Methods

propertyValid :: prop -> Property Source #

Property for valid input

propertyInvalid :: prop -> Property Source #

Property for invalid input

Instances

VarTesteable Bool Source #

Same as Testeable

(Arbitrary a, Variant a, Show a, Testable prop) => VarTesteable (a -> prop) Source #

Instead of variant we use valid or invalid generators

Methods

propertyValid :: (a -> prop) -> Property Source #

propertyInvalid :: (a -> prop) -> Property Source #