| Copyright | (c) 2017-2019 Rudy Matela |
|---|---|
| License | 3-Clause BSD (see the file LICENSE) |
| Maintainer | Rudy Matela <rudy@matela.com.br> |
| Safe Haskell | None |
| Language | Haskell2010 |
Test.Extrapolate.Core
Description
This module is part of Extrapolate, a library for generalization of counter-examples.
This is the core of extrapolate.
Synopsis
- listsOfLength :: Int -> [[a]] -> [[[a]]]
- setsOf :: [[a]] -> [[[a]]]
- bagsOf :: [[a]] -> [[[a]]]
- noDupListsOf :: [[a]] -> [[[a]]]
- normalizeT :: [[a]] -> [[a]]
- deleteT :: Eq a => a -> [[a]] -> [[a]]
- products :: [[[a]]] -> [[[a]]]
- listsOf :: [[a]] -> [[[a]]]
- productMaybeWith :: (a -> b -> Maybe c) -> [[a]] -> [[b]] -> [[c]]
- product3With :: (a -> b -> c -> d) -> [[a]] -> [[b]] -> [[c]] -> [[d]]
- noDupListCons :: Listable a => ([a] -> b) -> [[b]]
- mapCons :: (Listable a, Listable b) => ([(a, b)] -> c) -> [[c]]
- setCons :: Listable a => ([a] -> b) -> [[b]]
- bagCons :: Listable a => ([a] -> b) -> [[b]]
- deriveListableCascading :: Name -> DecsQ
- deriveListable :: Name -> DecsQ
- addWeight :: [[a]] -> Int -> [[a]]
- ofWeight :: [[a]] -> Int -> [[a]]
- 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]]
- 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]]
- 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]]
- 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]]
- 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]]
- cons7 :: (Listable a, Listable b, Listable c, Listable d, Listable e, Listable f, Listable g) => (a -> b -> c -> d -> e -> f -> g -> h) -> [[h]]
- cons6 :: (Listable a, Listable b, Listable c, Listable d, Listable e, Listable f) => (a -> b -> c -> d -> e -> f -> g) -> [[g]]
- (==>) :: Bool -> Bool -> Bool
- exists :: Testable a => Int -> a -> Bool
- fails :: Testable a => Int -> a -> Bool
- holds :: Testable a => Int -> a -> Bool
- witness :: Testable a => Int -> a -> Maybe [String]
- witnesses :: Testable a => Int -> a -> [[String]]
- (><) :: [[a]] -> [[b]] -> [[(a, b)]]
- (\\//) :: [[a]] -> [[a]] -> [[a]]
- (\/) :: [[a]] -> [[a]] -> [[a]]
- (+|) :: [a] -> [a] -> [a]
- suchThat :: [[a]] -> (a -> Bool) -> [[a]]
- reset :: [[a]] -> [[a]]
- delay :: [[a]] -> [[a]]
- cons5 :: (Listable a, Listable b, Listable c, Listable d, Listable e) => (a -> b -> c -> d -> e -> f) -> [[f]]
- cons4 :: (Listable a, Listable b, Listable c, Listable d) => (a -> b -> c -> d -> e) -> [[e]]
- cons3 :: (Listable a, Listable b, Listable c) => (a -> b -> c -> d) -> [[d]]
- cons2 :: (Listable a, Listable b) => (a -> b -> c) -> [[c]]
- cons1 :: Listable a => (a -> b) -> [[b]]
- cons0 :: a -> [[a]]
- concatMapT :: (a -> [[b]]) -> [[a]] -> [[b]]
- concatT :: [[[[a]]]] -> [[a]]
- filterT :: (a -> Bool) -> [[a]] -> [[a]]
- mapT :: (a -> b) -> [[a]] -> [[b]]
- tiersFloating :: Fractional a => [[a]]
- tiersFractional :: Fractional a => [[a]]
- listIntegral :: (Ord a, Num a) => [a]
- toTiers :: [a] -> [[a]]
- class Listable a where
- module Test.Extrapolate.Expr
- module Test.Extrapolate.Speculation
- module Test.Extrapolate.Generalizable
- module Test.Extrapolate.Generalization
- module Test.Extrapolate.ConditionalGeneralization
- module Test.Extrapolate.Testable
- counterExampleWithGeneralizations :: Testable a => a -> Maybe (Expr, [Expr])
Documentation
listsOfLength :: Int -> [[a]] -> [[[a]]] #
Takes as argument an integer length and tiers of element values; returns tiers of lists of element values of the given length.
listsOfLength 3 [[0],[1],[2],[3],[4]...] = [ [[0,0,0]] , [[0,0,1],[0,1,0],[1,0,0]] , [[0,0,2],[0,1,1],[0,2,0],[1,0,1],[1,1,0],[2,0,0]] , ... ]
Takes as argument tiers of element values; returns tiers of size-ordered lists of elements without repetition.
setsOf [[0],[1],[2],...] = [ [[]] , [[0]] , [[1]] , [[0,1],[2]] , [[0,2],[3]] , [[0,3],[1,2],[4]] , [[0,1,2],[0,4],[1,3],[5]] , ... ]
Can be used in the constructor of specialized Listable instances.
For Set (from Data.Set), we would have:
instance Listable a => Listable (Set a) where tiers = mapT fromList $ setsOf tiers
Takes as argument tiers of element values; returns tiers of size-ordered lists of elements possibly with repetition.
bagsOf [[0],[1],[2],...] = [ [[]] , [[0]] , [[0,0],[1]] , [[0,0,0],[0,1],[2]] , [[0,0,0,0],[0,0,1],[0,2],[1,1],[3]] , [[0,0,0,0,0],[0,0,0,1],[0,0,2],[0,1,1],[0,3],[1,2],[4]] , ... ]
noDupListsOf :: [[a]] -> [[[a]]] #
Takes as argument tiers of element values; returns tiers of lists with no repeated elements.
noDupListsOf [[0],[1],[2],...] == [ [[]] , [[0]] , [[1]] , [[0,1],[1,0],[2]] , [[0,2],[2,0],[3]] , ... ]
normalizeT :: [[a]] -> [[a]] #
Normalizes tiers by removing up to 12 empty tiers from the end of a list of tiers.
normalizeT [xs0,xs1,...,xsN,[]] = [xs0,xs1,...,xsN] normalizeT [xs0,xs1,...,xsN,[],[]] = [xs0,xs1,...,xsN]
The arbitrary limit of 12 tiers is necessary as this function would loop if there is an infinite trail of empty tiers.
deleteT :: Eq a => a -> [[a]] -> [[a]] #
Delete the first occurence of an element in a tier.
For normalized lists-of-tiers without repetitions, the following holds:
deleteT x = normalizeT . (`suchThat` (/= x))
products :: [[[a]]] -> [[[a]]] #
Takes the product of N lists of tiers, producing lists of length N.
Alternatively, takes as argument a list of lists of tiers of elements; returns lists combining elements of each list of tiers.
products [xss] = mapT (:[]) xss products [xss,yss] = mapT (\(x,y) -> [x,y]) (xss >< yss) products [xss,yss,zss] = product3With (\x y z -> [x,y,z]) xss yss zss
Takes as argument tiers of element values; returns tiers of lists of elements.
listsOf [[]] = [[[]]]
listsOf [[x]] = [ [[]]
, [[x]]
, [[x,x]]
, [[x,x,x]]
, ...
]listsOf [[x],[y]] = [ [[]]
, [[x]]
, [[x,x],[y]]
, [[x,x,x],[x,y],[y,x]]
, ...
]productMaybeWith :: (a -> b -> Maybe c) -> [[a]] -> [[b]] -> [[c]] #
product3With :: (a -> b -> c -> d) -> [[a]] -> [[b]] -> [[c]] -> [[d]] #
Like productWith, but over 3 lists of tiers.
noDupListCons :: Listable a => ([a] -> b) -> [[b]] #
Given a constructor that takes a list with no duplicate elements, return tiers of applications of this constructor.
mapCons :: (Listable a, Listable b) => ([(a, b)] -> c) -> [[c]] #
Given a constructor that takes a map of elements (encoded as a list), lists tiers of applications of this constructor
So long as the underlying Listable enumerations have no repetitions,
this will generate no repetitions.
This allows defining an efficient implementation of tiers that does not
repeat maps given by:
tiers = mapCons fromList
setCons :: Listable a => ([a] -> b) -> [[b]] #
Given a constructor that takes a set of elements (as a list), lists tiers of applications of this constructor.
A naive Listable instance for the Set (of Data.Set)
would read:
instance Listable a => Listable (Set a) where tiers = cons0 empty \/ cons2 insert
The above instance has a problem: it generates repeated sets. A more efficient implementation that does not repeat sets is given by:
tiers = setCons fromList
Alternatively, you can use setsOf direclty.
bagCons :: Listable a => ([a] -> b) -> [[b]] #
Given a constructor that takes a bag of elements (as a list), lists tiers of applications of this constructor.
For example, a Bag represented as a list.
bagCons Bag
deriveListableCascading :: Name -> DecsQ #
Derives a Listable instance for a given type Name
cascading derivation of type arguments as well.
Consider the following series of datatypes:
data Position = CEO | Manager | Programmer
data Person = Person
{ name :: String
, age :: Int
, position :: Position
}
data Company = Company
{ name :: String
, employees :: [Person]
}Writing
deriveListableCascading ''Company
will automatically derive the following three Listable instances:
instance Listable Position where tiers = cons0 CEO \/ cons0 Manager \/ cons0 Programmer instance Listable Person where tiers = cons3 Person instance Listable Company where tiers = cons2 Company
deriveListable :: Name -> DecsQ #
Derives a Listable instance for a given type Name.
Consider the following Stack datatype:
data Stack a = Stack a (Stack a) | Empty
Writing
deriveListable ''Stack
will automatically derive the following Listable instance:
instance Listable a => Listable (Stack a) where tiers = cons2 Stack \/ cons0 Empty
Warning: if the values in your type need to follow a data invariant, the derived instance won't respect it. Use this only on "free" datatypes.
Needs the TemplateHaskell extension.
addWeight :: [[a]] -> Int -> [[a]] #
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.
ofWeight :: [[a]] -> Int -> [[a]] #
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.
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]] #
Returns tiers of applications of a 12-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]] #
Returns tiers of applications of a 11-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]] #
Returns tiers of applications of a 10-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]] #
Returns tiers of applications of a 9-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]] #
Returns tiers of applications of a 8-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]] #
Returns tiers of applications of a 7-argument constructor.
cons6 :: (Listable a, Listable b, Listable c, Listable d, Listable e, Listable f) => (a -> b -> c -> d -> e -> f -> g) -> [[g]] #
Returns tiers of applications of a 6-argument constructor.
(==>) :: Bool -> Bool -> Bool infixr 0 #
Boolean implication operator. Useful for defining conditional properties:
prop_something x y = condition x y ==> something x y
Examples:
> prop_addMonotonic x y = y > 0 ==> x + y > x > check prop_addMonotonic +++ OK, passed 200 tests.
exists :: Testable a => Int -> a -> Bool #
There exists an assignment of values that satisfies a property up to a number of test values?
> exists 1000 $ \x -> x > 10 True
fails :: Testable a => Int -> a -> Bool #
Does a property fail for a number of test values?
> fails 1000 $ \xs -> xs ++ ys == ys ++ xs True
> holds 1000 $ \xs -> length (sort xs) == length xs False
This is the negation of holds.
holds :: Testable a => Int -> a -> Bool #
Does a property hold up to a number of test values?
> holds 1000 $ \xs -> length (sort xs) == length xs True
> holds 1000 $ \x -> x == x + 1 False
The suggested number of test values are 500, 1 000 or 10 000.
With more than that you may or may not run out of memory
depending on the types being tested.
This also applies to fails, exists, etc.
(cf. fails, counterExample)
witnesses :: Testable a => Int -> a -> [[String]] #
Lists all witnesses up to a number of tests to a property.
> witnesses 1000 (\x -> x > 1 && x < 77 && 77 `rem` x == 0) [["7"],["11"]]
(><) :: [[a]] -> [[b]] -> [[(a, b)]] infixr 8 #
Take a tiered product of lists of tiers.
[t0,t1,t2,...] >< [u0,u1,u2,...] = [ t0**u0 , t0**u1 ++ t1**u0 , t0**u2 ++ t1**u1 ++ t2**u0 , ... ... ... ... ] where xs ** ys = [(x,y) | x <- xs, y <- ys]
Example:
[[0],[1],[2],...] >< [[0],[1],[2],...] = [ [(0,0)] , [(1,0),(0,1)] , [(2,0),(1,1),(0,2)] , [(3,0),(2,1),(1,2),(0,3)] , ... ]
(cf. productWith)
(\\//) :: [[a]] -> [[a]] -> [[a]] infixr 7 #
Interleave tiers --- sum of two tiers enumerations.
When in doubt, use \/ instead.
[xs,ys,zs,...] \/ [as,bs,cs,...] = [xs+|as, ys+|bs, zs+|cs, ...]
(\/) :: [[a]] -> [[a]] -> [[a]] infixr 7 #
Append tiers --- sum of two tiers enumerations.
[xs,ys,zs,...] \/ [as,bs,cs,...] = [xs++as, ys++bs, zs++cs, ...]
(+|) :: [a] -> [a] -> [a] infixr 5 #
Lazily interleaves two lists, switching between elements of the two. Union/sum of the elements in the lists.
[x,y,z,...] +| [a,b,c,...] = [x,a,y,b,z,c,...]
suchThat :: [[a]] -> (a -> Bool) -> [[a]] #
Tiers of values that follow a property.
Typically used in the definition of Listable tiers:
instance Listable <Type> where
tiers = ...
\/ cons<N> `suchThat` <condition>
\/ ...Examples:
> tiers `suchThat` odd [[], [1], [-1], [], [], [3], [-3], [], [], [5], ...]
> tiers `suchThat` even [[0], [], [], [2], [-2], [], [], [4], [-4], [], ...]
Resets any delays in a list-of tiers.
Conceptually this function makes a constructor "weightless",
assuring the first tier is non-empty.
reset [[], [], ..., xs, ys, zs, ...] = [xs, ys, zs, ...]
reset [[], xs, ys, zs, ...] = [xs, ys, zs, ...]
reset [[], [], ..., [x], [y], [z], ...] = [[x], [y], [z], ...]
Typically used when defining Listable instances:
instance Listable <Type> where
tiers = ...
\/ reset (cons<N> <Constructor>)
\/ ...Be careful: do not apply reset to recursive data structure
constructors. In general this will make the list of size 0 infinite,
breaking the tiers invariant (each tier must be finite).
Delays the enumeration of tiers.
Conceptually this function adds to the weight of a constructor.
delay [xs, ys, zs, ... ] = [[], xs, ys, zs, ...]
delay [[x,...], [y,...], ...] = [[], [x,...], [y,...], ...]
Typically used when defining Listable instances:
instance Listable <Type> where
tiers = ...
\/ delay (cons<N> <Constructor>)
\/ ...cons5 :: (Listable a, Listable b, Listable c, Listable d, Listable e) => (a -> b -> c -> d -> e -> f) -> [[f]] #
Given a constructor with no arguments,
returns tiers of all possible applications of this constructor.
Since in this case there is only one possible application (to no arguments), only a single value, of size/weight 0, will be present in the resulting list of tiers.
To be used in the declaration of tiers in Listable instances.
instance Listable <Type> where
tiers = ...
\/ cons0 <Constructor>
\/ ...concatMapT :: (a -> [[b]]) -> [[a]] -> [[b]] #
concatT :: [[[[a]]]] -> [[a]] #
concat tiers of tiers
concatT [ [xss0, yss0, zss0, ...]
, [xss1, yss1, zss1, ...]
, [xss2, yss2, zss2, ...]
, ...
]
= xss0 \/ yss0 \/ zss0 \/ ...
\/ delay (xss1 \/ yss1 \/ zss1 \/ ...
\/ delay (xss2 \/ yss2 \/ zss2 \/ ...
\/ (delay ...)))(cf. concatMapT)
filterT :: (a -> Bool) -> [[a]] -> [[a]] #
filter tiers
filterT p [xs, yz, zs, ...] = [filter p xs, filter p ys, filter p zs]
filterT odd tiers = [[], [1], [-1], [], [], [3], [-3], [], [], [5], ...]
mapT :: (a -> b) -> [[a]] -> [[b]] #
map over tiers
mapT f [[x], [y,z], [w,...], ...] = [[f x], [f y, f z], [f w, ...], ...]
mapT f [xs, ys, zs, ...] = [map f xs, map f ys, map f zs]
tiersFloating :: Fractional a => [[a]] #
Tiers of Floating values.
This can be used as the implementation of tiers for Floating types.
This function is equivalent to tiersFractional
with positive and negative infinities included: 10 and -10.
tiersFloating :: [[Float]] = [ [0.0] , [1.0] , [-1.0, Infinity] , [ 0.5, 2.0, -Infinity] , [-0.5, -2.0] , [ 0.33333334, 3.0] , [-0.33333334, -3.0] , [ 0.25, 0.6666667, 1.5, 4.0] , [-0.25, -0.6666667, -1.5, -4.0] , [ 0.2, 5.0] , [-0.2, -5.0] , [ 0.16666667, 0.4, 0.75, 1.3333334, 2.5, 6.0] , [-0.16666667, -0.4, -0.75, -1.3333334, -2.5, -6.0] , ... ]
NaN and -0 are excluded from this enumeration.
tiersFractional :: Fractional a => [[a]] #
Tiers of Fractional values.
This can be used as the implementation of tiers for Fractional types.
tiersFractional :: [[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] , [ 1 % 6, 2 % 5, 3 % 4, 4 % 3, 5 % 2, 6 % 1] , [(-1) % 6, (-2) % 5, (-3) % 4, (-4) % 3, (-5) % 2, (-6) % 1] , ... ]
listIntegral :: (Ord a, Num a) => [a] #
Tiers of Integral values.
Can be used as a default implementation of list for Integral types.
For types with negative values, like Int,
the list starts with 0 then intercalates between positives and negatives.
listIntegral = [0, 1, -1, 2, -2, 3, -3, 4, -4, ...]
For types without negative values, like Word,
the list starts with 0 followed by positives of increasing magnitude.
listIntegral = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...]
This function will not work for types that throw errors when the result of
an arithmetic operation is negative such as Natural. For these, use
[0..] as the list implementation.
Takes a list of values xs and transform it into tiers on which each
tier is occupied by a single element from xs.
toTiers [x, y, z, ...] = [[x], [y], [z], ...]
To convert back to a list, just concat.
A type is Listable when there exists a function that
is able to list (ideally all of) its values.
Ideally, instances should be defined by a tiers function that
returns a (potentially infinite) list of finite sub-lists (tiers):
the first sub-list contains elements of size 0,
the second sub-list contains elements of size 1
and so on.
Size here is defined by the implementor of the type-class instance.
For algebraic data types, the general form for tiers is
tiers = cons<N> ConstructorA
\/ cons<N> ConstructorB
\/ ...
\/ cons<N> ConstructorZwhere N is the number of arguments of each constructor A...Z.
Here is a datatype with 4 constructors and its listable instance:
data MyType = MyConsA
| MyConsB Int
| MyConsC Int Char
| MyConsD String
instance Listable MyType where
tiers = cons0 MyConsA
\/ cons1 MyConsB
\/ cons2 MyConsC
\/ cons1 MyConsDThe instance for Hutton's Razor is given by:
data Expr = Val Int
| Add Expr Expr
instance Listable Expr where
tiers = cons1 Val
\/ cons2 AddInstances can be alternatively defined by list.
In this case, each sub-list in tiers is a singleton list
(each succeeding element of list has +1 size).
The function deriveListable from Test.LeanCheck.Derive
can automatically derive instances of this typeclass.
A Listable instance for functions is also available but is not exported by
default. Import Test.LeanCheck.Function if you need to test higher-order
properties.
Instances
| Listable Bool | tiers :: [[Bool]] = [[False,True]] list :: [[Bool]] = [False,True] |
| Listable Char | list :: [Char] = ['a', ' ', 'b', 'A', 'c', '\', 'n', 'd', ...] |
| Listable Double |
list :: [Double] = [0.0, 1.0, -1.0, Infinity, 0.5, 2.0, ...] |
| Listable Float |
list :: [Float] = [ 0.0 , 1.0, -1.0, Infinity , 0.5, 2.0, -Infinity, -0.5, -2.0 , 0.33333334, 3.0, -0.33333334, -3.0 , 0.25, 0.6666667, 1.5, 4.0, -0.25, -0.6666667, -1.5, -4.0 , ... ] |
| Listable Int | tiers :: [[Int]] = [[0], [1], [-1], [2], [-2], [3], [-3], ...] list :: [Int] = [0, 1, -1, 2, -2, 3, -3, 4, -4, 5, -5, 6, ...] |
| Listable Integer | list :: [Int] = [0, 1, -1, 2, -2, 3, -3, 4, -4, 5, -5, 6, ...] |
| Listable Ordering | list :: [Ordering] = [LT, EQ, GT] |
| Listable () | list :: [()] = [()] tiers :: [[()]] = [[()]] |
Defined in Test.LeanCheck.Core | |
| Listable Int1 | |
| Listable Int2 | |
| Listable Int3 | |
| Listable Int4 | |
| Listable Word1 | |
| Listable Word2 | |
| Listable Word3 | |
| Listable Word4 | |
| Listable Natural | |
| Listable Nat | |
| Listable Nat1 | |
| Listable Nat2 | |
| Listable Nat3 | |
| Listable Nat4 | |
| Listable Nat5 | |
| Listable Nat6 | |
| Listable Nat7 | |
| Listable A | |
| Listable B | |
| Listable C | |
| Listable D | |
| Listable E | |
| Listable F | |
| Listable Space | |
| Listable Lower | |
| Listable Upper | |
| Listable Alpha | |
| Listable Digit | |
| Listable AlphaNum | |
| Listable Letter | |
| Listable Spaces | |
| Listable Lowers | |
| Listable Uppers | |
| Listable Alphas | |
| Listable Digits | |
| Listable AlphaNums | |
| Listable Letters | |
| Listable a => Listable [a] | tiers :: [[ [Int] ]] = [ [ [] ]
, [ [0] ]
, [ [0,0], [1] ]
, [ [0,0,0], [0,1], [1,0], [-1] ]
, ... ]
list :: [ [Int] ] = [ [], [0], [0,0], [1], [0,0,0], ... ] |
Defined in Test.LeanCheck.Core | |
| Listable a => Listable (Maybe a) | tiers :: [[Maybe Int]] = [[Nothing], [Just 0], [Just 1], ...] tiers :: [[Maybe Bool]] = [[Nothing], [Just False, Just True]] |
| Listable a => Listable (NoDup a) | |
| Listable a => Listable (Bag a) | |
| Listable a => Listable (Set a) | |
| (Integral a, Bounded a) => Listable (X a) | Extremily large integers are intercalated with small integers. list :: [X Int] = map X
[ 0, 1, -1, maxBound, minBound
, 2, -2, maxBound-1, minBound+1
, 3, -3, maxBound-2, minBound+2
, ... ] |
| (Integral a, Bounded a) => Listable (Xs a) | Lists with elements of the |
| (Listable a, Listable b) => Listable (Either a b) | tiers :: [[Either Bool Bool]] =
[[Left False, Right False, Left True, Right True]]
tiers :: [[Either Int Int]] = [ [Left 0, Right 0]
, [Left 1, Right 1]
, [Left (-1), Right (-1)]
, [Left 2, Right 2]
, ... ] |
| (Listable a, Listable b) => Listable (a, b) | tiers :: [[(Int,Int)]] = [ [(0,0)] , [(0,1),(1,0)] , [(0,-1),(1,1),(-1,0)] , ...] list :: [(Int,Int)] = [ (0,0), (0,1), (1,0), (0,-1), (1,1), ...] |
Defined in Test.LeanCheck.Core | |
| (Listable a, Listable b) => Listable (Map a b) | |
| (Listable a, Listable b, Listable c) => Listable (a, b, c) | list :: [(Int,Int,Int)] = [ (0,0,0), (0,0,1), (0,1,0), ...] |
Defined in Test.LeanCheck.Core | |
| (Listable a, Listable b, Listable c, Listable d) => Listable (a, b, c, d) | |
Defined in Test.LeanCheck.Core | |
| (Listable a, Listable b, Listable c, Listable d, Listable e) => Listable (a, b, c, d, e) | |
Defined in Test.LeanCheck.Core | |
module Test.Extrapolate.Expr
module Test.Extrapolate.Speculation
module Test.Extrapolate.Testable