leancheck-1.0.0: Enumerative property-based testing
Copyright(c) 2015-2020 Rudy Matela
License3-Clause BSD (see the file LICENSE)
MaintainerRudy Matela <rudy@matela.com.br>
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.LeanCheck.Basic

Description

This module is part of LeanCheck, a simple enumerative property-based testing library.

This module exports Test.LeanCheck.Core along with:

The above includes all types defined in the Haskell 2010 Report with the exception of Array, IO, Handle, HandlePosn, IOErrorType.

Test.LeanCheck already exports everything from this module. You are probably better off importing it.

You should only import Test.LeanCheck.Basic if you only want the above basic functionality.

Synopsis

Documentation

cons6 :: (Listable a, Listable b, Listable c, Listable d, Listable e, Listable f) => (a -> b -> c -> d -> e -> f -> g) -> [[g]] Source #

Returns tiers of applications of a 6-argument constructor.

cons7 :: (Listable a, Listable b, Listable c, Listable d, Listable e, Listable f, Listable g) => (a -> b -> c -> d -> e -> f -> g -> h) -> [[h]] Source #

Returns tiers of applications of a 7-argument constructor.

cons8 :: (Listable a, Listable b, Listable c, Listable d, Listable e, Listable f, Listable g, Listable h) => (a -> b -> c -> d -> e -> f -> g -> h -> i) -> [[i]] Source #

Returns tiers of applications of a 8-argument constructor.

cons9 :: (Listable a, Listable b, Listable c, Listable d, Listable e, Listable f, Listable g, Listable h, Listable i) => (a -> b -> c -> d -> e -> f -> g -> h -> i -> j) -> [[j]] Source #

Returns tiers of applications of a 9-argument constructor.

cons10 :: (Listable a, Listable b, Listable c, Listable d, Listable e, Listable f, Listable g, Listable h, Listable i, Listable j) => (a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k) -> [[k]] Source #

Returns tiers of applications of a 10-argument constructor.

cons11 :: (Listable a, Listable b, Listable c, Listable d, Listable e, Listable f, Listable g, Listable h, Listable i, Listable j, Listable k) => (a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k -> l) -> [[l]] Source #

Returns tiers of applications of a 11-argument constructor.

cons12 :: (Listable a, Listable b, Listable c, Listable d, Listable e, Listable f, Listable g, Listable h, Listable i, Listable j, Listable k, Listable l) => (a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k -> l -> m) -> [[m]] Source #

Returns tiers of applications of a 12-argument constructor.

ofWeight :: [[a]] -> Int -> [[a]] Source #

Resets the weight of a constructor or tiers.

> [ [], [], ..., xs, ys, zs, ... ] `ofWeight` 1
[ [], xs, ys, zs, ... ]
> [ xs, ys, zs, ... ] `ofWeight` 2
[ [], [], xs, ys, zs, ... ]
> [ [], xs, ys, zs, ... ] `ofWeight` 3
[ [], [], [], xs, ys, zs, ... ]

Typically used as an infix operator when defining Listable instances:

instance Listable <Type> where
  tiers  =  ...
         \/ cons<N> <Cons>  `ofWeight`  <W>
         \/ ...

Warning: do not apply `ofWeight` 0 to recursive data structure constructors. In general this will make the list of size 0 infinite, breaking the tier invariant (each tier must be finite).

`ofWeight` n is equivalent to reset followed by n applications of delay.

addWeight :: [[a]] -> Int -> [[a]] Source #

Adds to the weight of a constructor or tiers.

instance Listable <Type> where
  tiers  =  ...
         \/ cons<N> <Cons>  `addWeight`  <W>
         \/ ...

Typically used as an infix operator when defining Listable instances:

> [ xs, ys, zs, ... ] `addWeight` 1
[ [], xs, ys, zs, ... ]
> [ xs, ys, zs, ... ] `addWeight` 2
[ [], [], xs, ys, zs, ... ]
> [ [], xs, ys, zs, ... ] `addWeight` 3
[ [], [], [], [], xs, ys, zs, ... ]

`addWeight` n is equivalent to n applications of delay.

Orphan instances

Listable Int8 Source #
list :: [Int8]  =  [0, 1, -1, 2, -2, 3, -3, ..., 127, -127, -128]
Instance details

Methods

tiers :: [[Int8]] Source #

list :: [Int8] Source #

Listable Int16 Source #
list :: [Int16]  =  [0, 1, -1, 2, -2, ..., 32767, -32767, -32768]
Instance details

Methods

tiers :: [[Int16]] Source #

list :: [Int16] Source #

Listable Int32 Source #
list :: [Int32]  =  [0, 1, -1, 2, -2, 3, -3, 4, -4, 5, -5, 6, ...]
Instance details

Methods

tiers :: [[Int32]] Source #

list :: [Int32] Source #

Listable Int64 Source #
list :: [Int64]  =  [0, 1, -1, 2, -2, 3, -3, 4, -4, 5, -5, 6, ...]
Instance details

Methods

tiers :: [[Int64]] Source #

list :: [Int64] Source #

Listable Word Source #
list :: [Word]  =  [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...]
Instance details

Methods

tiers :: [[Word]] Source #

list :: [Word] Source #

Listable Word8 Source #
list :: [Word8]  =  [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ..., 255]
Instance details

Methods

tiers :: [[Word8]] Source #

list :: [Word8] Source #

Listable Word16 Source #
list :: [Word16]  =  [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ..., 65535]
Instance details

Methods

tiers :: [[Word16]] Source #

list :: [Word16] Source #

Listable Word32 Source #
list :: [Word32]  =  [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...]
Instance details

Methods

tiers :: [[Word32]] Source #

list :: [Word32] Source #

Listable Word64 Source #
list :: [Word64]  =  [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...]
Instance details

Methods

tiers :: [[Word64]] Source #

list :: [Word64] Source #

Listable ExitCode Source #

Only includes valid POSIX exit codes

> list :: [ExitCode]
[ExitSuccess, ExitFailure 1, ExitFailure 2, ..., ExitFailure 255]
Instance details

Listable BufferMode Source # 
Instance details

Listable SeekMode Source # 
Instance details

Listable CChar Source # 
Instance details

Methods

tiers :: [[CChar]] Source #

list :: [CChar] Source #

Listable CSChar Source # 
Instance details

Methods

tiers :: [[CSChar]] Source #

list :: [CSChar] Source #

Listable CUChar Source # 
Instance details

Methods

tiers :: [[CUChar]] Source #

list :: [CUChar] Source #

Listable CShort Source # 
Instance details

Methods

tiers :: [[CShort]] Source #

list :: [CShort] Source #

Listable CUShort Source # 
Instance details

Methods

tiers :: [[CUShort]] Source #

list :: [CUShort] Source #

Listable CInt Source # 
Instance details

Methods

tiers :: [[CInt]] Source #

list :: [CInt] Source #

Listable CUInt Source # 
Instance details

Methods

tiers :: [[CUInt]] Source #

list :: [CUInt] Source #

Listable CLong Source # 
Instance details

Methods

tiers :: [[CLong]] Source #

list :: [CLong] Source #

Listable CULong Source # 
Instance details

Methods

tiers :: [[CULong]] Source #

list :: [CULong] Source #

Listable CLLong Source # 
Instance details

Methods

tiers :: [[CLLong]] Source #

list :: [CLLong] Source #

Listable CULLong Source # 
Instance details

Methods

tiers :: [[CULLong]] Source #

list :: [CULLong] Source #

Listable CBool Source # 
Instance details

Methods

tiers :: [[CBool]] Source #

list :: [CBool] Source #

Listable CFloat Source # 
Instance details

Methods

tiers :: [[CFloat]] Source #

list :: [CFloat] Source #

Listable CDouble Source # 
Instance details

Methods

tiers :: [[CDouble]] Source #

list :: [CDouble] Source #

Listable CPtrdiff Source # 
Instance details

Listable CSize Source # 
Instance details

Methods

tiers :: [[CSize]] Source #

list :: [CSize] Source #

Listable CWchar Source # 
Instance details

Methods

tiers :: [[CWchar]] Source #

list :: [CWchar] Source #

Listable CSigAtomic Source # 
Instance details

Listable CClock Source # 
Instance details

Methods

tiers :: [[CClock]] Source #

list :: [CClock] Source #

Listable CTime Source # 
Instance details

Methods

tiers :: [[CTime]] Source #

list :: [CTime] Source #

Listable CUSeconds Source # 
Instance details

Listable CSUSeconds Source # 
Instance details

Listable CIntPtr Source # 
Instance details

Methods

tiers :: [[CIntPtr]] Source #

list :: [CIntPtr] Source #

Listable CUIntPtr Source # 
Instance details

Listable CIntMax Source # 
Instance details

Methods

tiers :: [[CIntMax]] Source #

list :: [CIntMax] Source #

Listable CUIntMax Source # 
Instance details

Listable IOMode Source # 
Instance details

Methods

tiers :: [[IOMode]] Source #

list :: [IOMode] Source #

Listable GeneralCategory Source # 
Instance details

(Integral a, Listable a) => Listable (Ratio a) Source #
list :: [Rational]  =
  [   0  % 1
  ,   1  % 1
  , (-1) % 1
  ,   1  % 2,   2  % 1
  , (-1) % 2, (-2) % 1
  ,   1  % 3,   3  % 1
  , (-1) % 3, (-3) % 1
  ,   1  % 4,   2  % 3,   3  % 2,   4  % 1
  , (-1) % 4, (-2) % 3, (-3) % 2, (-4) % 1
  ,   1  % 5,   5  % 1
  , (-1) % 5, (-5) % 1
  , ...
  ]
Instance details

Methods

tiers :: [[Ratio a]] Source #

list :: [Ratio a] Source #

(RealFloat a, Listable a) => Listable (Complex a) Source # 
Instance details

Methods

tiers :: [[Complex a]] Source #

list :: [Complex a] Source #

(Listable a, Listable b, Listable c, Listable d, Listable e, Listable f) => Listable (a, b, c, d, e, f) Source # 
Instance details

Methods

tiers :: [[(a, b, c, d, e, f)]] Source #

list :: [(a, b, c, d, e, f)] Source #

(Listable a, Listable b, Listable c, Listable d, Listable e, Listable f, Listable g) => Listable (a, b, c, d, e, f, g) Source # 
Instance details

Methods

tiers :: [[(a, b, c, d, e, f, g)]] Source #

list :: [(a, b, c, d, e, f, g)] Source #

(Listable a, Listable b, Listable c, Listable d, Listable e, Listable f, Listable g, Listable h) => Listable (a, b, c, d, e, f, g, h) Source # 
Instance details

Methods

tiers :: [[(a, b, c, d, e, f, g, h)]] Source #

list :: [(a, b, c, d, e, f, g, h)] Source #

(Listable a, Listable b, Listable c, Listable d, Listable e, Listable f, Listable g, Listable h, Listable i) => Listable (a, b, c, d, e, f, g, h, i) Source # 
Instance details

Methods

tiers :: [[(a, b, c, d, e, f, g, h, i)]] Source #

list :: [(a, b, c, d, e, f, g, h, i)] Source #

(Listable a, Listable b, Listable c, Listable d, Listable e, Listable f, Listable g, Listable h, Listable i, Listable j) => Listable (a, b, c, d, e, f, g, h, i, j) Source # 
Instance details

Methods

tiers :: [[(a, b, c, d, e, f, g, h, i, j)]] Source #

list :: [(a, b, c, d, e, f, g, h, i, j)] Source #

(Listable a, Listable b, Listable c, Listable d, Listable e, Listable f, Listable g, Listable h, Listable i, Listable j, Listable k) => Listable (a, b, c, d, e, f, g, h, i, j, k) Source # 
Instance details

Methods

tiers :: [[(a, b, c, d, e, f, g, h, i, j, k)]] Source #

list :: [(a, b, c, d, e, f, g, h, i, j, k)] Source #

(Listable a, Listable b, Listable c, Listable d, Listable e, Listable f, Listable g, Listable h, Listable i, Listable j, Listable k, Listable l) => Listable (a, b, c, d, e, f, g, h, i, j, k, l) Source # 
Instance details

Methods

tiers :: [[(a, b, c, d, e, f, g, h, i, j, k, l)]] Source #

list :: [(a, b, c, d, e, f, g, h, i, j, k, l)] Source #