!A\      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                  ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                                                                                                                                   ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^_`abcdefghijklmnopqrstuvwxyz{|}~(c) 2015-2020 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>Safe. leancheck values are functions of & arguments that return boolean values.  Bool  Listable a => a -> Bool + (Listable a, Listable b) => a -> b -> Bool < (Listable a, Listable b, Listable c) => a -> b -> c -> Bool H (Listable a, Listable b, Listable c, ...) => a -> b -> c -> ... -> Bool For example:  Int -> Bool  String -> [Int] -> Bool leancheck A type is R when there exists a function that is able to list (ideally all of) its values.*Ideally, instances should be defined by a  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  is btiers = cons<N> ConstructorA \/ cons<N> ConstructorB \/ ... \/ cons<N> ConstructorZwhere N0 is the number of arguments of each constructor A...Z.AHere 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 MyConsD,The instance for Hutton's Razor is given by: {data Expr = Val Int | Add Expr Expr instance Listable Expr where tiers = cons1 Val \/ cons2 Add*Instances can be alternatively defined by ". In this case, each sub-list in 2 is a singleton list (each succeeding element of  has +1 size). The function  from Test.LeanCheck.Derive7 can automatically derive instances of this typeclass.A S instance for functions is also available but is not exported by default. Import Test.LeanCheck.Function. if you need to test higher-order properties. leancheckTakes a list of values xsX 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 . leancheck Tiers of 7 values. Can be used as a default implementation of  for  types.%For types with negative values, like L, the list starts with 0 then intercalates between positives and negatives. 5listIntegral = [0, 1, -1, 2, -2, 3, -3, 4, -4, ...](For types without negative values, like H, the list starts with 0 followed by positives of increasing magnitude. 4listIntegral = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...]xThis function will not work for types that throw errors when the result of an arithmetic operation is negative such as . For these, use [0..] as the  implementation. leancheck Tiers of 6 values. This can be used as the implementation of  for  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] , ... ] leancheck Tiers of  6 values. This can be used as the implementation of  for   types.This function is equivalent to 5 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.  leancheck  over tiers JmapT 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]  leancheck  tiers GfilterT p [xs, yz, zs, ...] = [filter p xs, filter p ys, filter p zs] JfilterT odd tiers = [[], [1], [-1], [], [], [3], [-3], [], [], [5], ...]  leancheck tiers of tiers  leancheck  over tiers  leancheck2Given a constructor with no arguments, returns  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. leancheckGiven a constructor with one  argument, return ` of applications of this constructor. By default, returned values will have size/weight of 1. leancheckGiven a constructor with two  arguments, return ` of applications of this constructor. By default, returned values will have size/weight of 1. leancheck:Returns tiers of applications of a 3-argument constructor. leancheck:Returns tiers of applications of a 4-argument constructor. leancheck:Returns tiers of applications of a 5-argument constructor. leancheckDelays the enumeration of B. Conceptually this function adds to the weight of a constructor. 2delay [xs, ys, zs, ... ] = [[], xs, ys, zs, ...] =delay [[x,...], [y,...], ...] = [[], [x,...], [y,...], ...]Typically used when defining  instances: hinstance Listable <Type> where tiers = ... \/ delay (cons<N> <Constructor>) \/ ... leancheckResets any delays in a list-of f. Conceptually this function makes a constructor "weightless", assuring the first tier is non-empty. :reset [[], [], ..., xs, ys, zs, ...] = [xs, ys, zs, ...] 1reset [[], xs, ys, zs, ...] = [xs, ys, zs, ...] @reset [[], [], ..., [x], [y], [z], ...] = [[x], [y], [z], ...]Typically used when defining  instances: hinstance Listable <Type> where tiers = ... \/ reset (cons<N> <Constructor>) \/ ...Be careful: do not apply resetr to recursive data structure constructors. In general this will make the list of size 0 infinite, breaking the & invariant (each tier must be finite). leancheck'Tiers of values that follow a property.$Typically used in the definition of  tiers: iinstance Listable <Type> where tiers = ... \/ cons<N> `suchThat` <condition> \/ ... Examples: K> tiers `suchThat` odd [[], [1], [-1], [], [], [3], [-3], [], [], [5], ...] L> tiers `suchThat` even [[0], [], [], [2], [-2], [], [], [4], [-4], [], ...]This function is just a  ped version of  . leancheckoLazily interleaves two lists, switching between elements of the two. Union/sum of the elements in the lists. 0[x,y,z,...] +| [a,b,c,...] = [x,a,y,b,z,c,...] leancheck/Append tiers --- sum of two tiers enumerations. B[xs,ys,zs,...] \/ [as,bs,cs,...] = [xs++as, ys++bs, zs++cs, ...] leancheckJInterleave tiers --- sum of two tiers enumerations. When in doubt, use  instead. B[xs,ys,zs,...] \/ [as,bs,cs,...] = [xs+|as, ys+|bs, zs+|cs, ...] leancheck(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)] , ... ] leancheck,Take a tiered product of lists of tiers.  can be defined by , as: 6productWith f xss yss = map (uncurry f) $ xss >< yss leancheckList all results of a Q property. Each result is a pair of a list of strings and a boolean. The list of strings is a printable representation of one possible choice of argument values for the property. Each boolean paired with such a list indicates whether the property holds for this choice. The outer list is potentially infinite and lazily evaluated. > results (<) [ (["0","0"], False) , (["0","1"], True) , (["1","0"], False) , (["0","(-1)"], False) , (["1","1"], False) , (["(-1)","0"], True) , (["0","2"], True) , (["1","(-1)"], False) , ... ] > take 10 $ results (\xs -> xs == nub (xs :: [Int])) [ (["[]"], True) , (["[0]"], True) , (["[0,0]"], False) , (["[1]"], True) , (["[0,0,0]"], False) , ... ] leancheck?Lists all counter-examples for a number of tests to a property, s> counterExamples 12 $ \xs -> xs == nub (xs :: [Int]) [["[0,0]"],["[0,0,0]"],["[0,0,0,0]"],["[0,0,1]"],["[0,1,0]"]] leancheck2Up to a number of tests to a property, returns ! the first counter-example or  if there is none. I> counterExample 100 $ \xs -> [] `union` xs == (xs::[Int]) Just ["[0,0]"] leancheck:Lists all witnesses up to a number of tests to a property. J> witnesses 1000 (\x -> x > 1 && x < 77 && 77 `rem` x == 0) [["7"],["11"]] leancheck2Up to a number of tests to a property, returns  the first witness or  if there is none. D> witness 1000 (\x -> x > 1 && x < 77 && 77 `rem` x == 0) Just ["7"]  leancheckDoes a property hold up to a number of test values? 1holds 1000 $ \xs -> length (sort xs) == length xsThe 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 !, ", etc.! leancheckDoes a property fail for a number of test values? (fails 1000 $ \xs -> xs ++ ys == ys ++ xs" leancheckThere existsT an assignment of values that satisfies a property up to a number of test values? exists 1000 $ \x -> x > 10# leancheckJBoolean implication operator. Useful for defining conditional properties: 4prop_something x y = condition x y ==> something x y Examples: c> prop_addMonotonic x y = y > 0 ==> x + y > x > check prop_addMonotonic +++ OK, passed 200 tests.$ leancheck "list :: [Ordering] = [LT, EQ, GT]% leancheckNaN and -0! are not included in the list of s. >list :: [Double] = [0.0, 1.0, -1.0, Infinity, 0.5, 2.0, ...]& leancheckNaN and -0! are not included in the list of s. 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 , ... ]' leancheck tiers :: [[ [Int] ]] = [ [ [] ] , [ [0] ] , [ [0,0], [1] ] , [ [0,0,0], [0,1], [1,0], [-1] ] , ... ] list :: [ [Int] ] = [ [], [0], [0,0], [1], [0,0,0], ... ]* leancheck ;list :: [(Int,Int,Int)] = [ (0,0,0), (0,0,1), (0,1,0), ...]+ leancheck 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), ...], leancheck Htiers :: [[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] , ... ]- leancheck |tiers :: [[Maybe Int]] = [[Nothing], [Just 0], [Just 1], ...] tiers :: [[Maybe Bool]] = [[Nothing], [Just False, Just True]]. leancheck Btiers :: [[Bool]] = [[False,True]] list :: [[Bool]] = [False,True]/ leancheck >list :: [Char] = ['a', ' ', 'b', 'A', 'c', '\', 'n', 'd', ...]0 leancheck >list :: [Int] = [0, 1, -1, 2, -2, 3, -3, 4, -4, 5, -5, 6, ...]1 leancheck }tiers :: [[Int]] = [[0], [1], [-1], [2], [-2], [3], [-3], ...] list :: [Int] = [0, 1, -1, 2, -2, 3, -3, 4, -4, 5, -5, 6, ...]2 leancheck 0list :: [()] = [()] tiers :: [[()]] = [[()]]$  !"#$ !"  #5778#0(c) 2015-2020 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>Safe v5 leancheck:Returns tiers of applications of a 6-argument constructor.6 leancheck:Returns tiers of applications of a 7-argument constructor.7 leancheck:Returns tiers of applications of a 8-argument constructor.8 leancheck:Returns tiers of applications of a 9-argument constructor.9 leancheck;Returns tiers of applications of a 10-argument constructor.: leancheck;Returns tiers of applications of a 11-argument constructor.; leancheck;Returns tiers of applications of a 12-argument constructor.< leancheck,Resets the weight of a constructor or tiers. G> [ [], [], ..., xs, ys, zs, ... ] `ofWeight` 1 [ [], xs, ys, zs, ... ] >> [ xs, ys, zs, ... ] `ofWeight` 2 [ [], [], xs, ys, zs, ... ] F> [ [], xs, ys, zs, ... ] `ofWeight` 3 [ [], [], [], xs, ys, zs, ... ]2Typically used as an infix operator when defining  instances: jinstance 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  followed by n applications of .= leancheck-Adds to the weight of a constructor or tiers. kinstance Listable <Type> where tiers = ... \/ cons<N> <Cons> `addWeight` <W> \/ ...2Typically used as an infix operator when defining  instances: ;> [ xs, ys, zs, ... ] `addWeight` 1 [ [], xs, ys, zs, ... ] ?> [ xs, ys, zs, ... ] `addWeight` 2 [ [], [], xs, ys, zs, ... ] K> [ [], xs, ys, zs, ... ] `addWeight` 3 [ [], [], [], [], xs, ys, zs, ... ] `addWeight` n  is equivalent to n applications of .B leancheck$Only includes valid POSIX exit codes V> list :: [ExitCode] [ExitSuccess, ExitFailure 1, ExitFailure 2, ..., ExitFailure 255]] leancheck @list :: [Int64] = [0, 1, -1, 2, -2, 3, -3, 4, -4, 5, -5, 6, ...]^ leancheck @list :: [Int32] = [0, 1, -1, 2, -2, 3, -3, 4, -4, 5, -5, 6, ...]_ leancheck ?list :: [Int16] = [0, 1, -1, 2, -2, ..., 32767, -32767, -32768]` leancheck ?list :: [Int8] = [0, 1, -1, 2, -2, 3, -3, ..., 127, -127, -128]a leancheck >list :: [Word64] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...]b leancheck >list :: [Word32] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...]c leancheck =list :: [Word16] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ..., 65535]d leancheck :list :: [Word8] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ..., 255]e leancheck <list :: [Word] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...]g leancheck '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 , ... ]-  !"#56789:;<= 56789:;<=(c) 2015-2020 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>None/o leancheck Derives a  instance for a given type .Consider the following Stack datatype: (data Stack a = Stack a (Stack a) | EmptyWriting deriveListable ''Stack(will automatically derive the following  instance: Tinstance Listable a => Listable (Stack a) where tiers = cons2 Stack \/ cons0 EmptyWarning: 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.p leancheckSame as oP but does not warn when the requested instance already exists. The function o% is preferable in most situations.q leancheck Derives a  instance for a given type 3 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  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 Companyr leancheck Given a type 9, derives an expression to be placed as the result of : 'consN C1 \/ consN C2 \/ ... \/ consN CN/This function can be used in the definition of  instances: 7instance Listable MyType where tiers = $(deriveTiers)s leancheck Given a type 9, derives an expression to be placed as the result of : 0concat $ consN C1 \/ consN C2 \/ ... \/ consN CN leancheckgGiven a type name, return the number of arguments taken by that type. Examples in partially broken TH: arity ''Int === Q 0 arity ''Int->Int === Q 0 arity ''Maybe === Q 1 arity ''Either === Q 2 arity ''Int-> === Q 1ZThis works for Data's and Newtype's and it is useful when generating typeclass instances.opqrsopqrs(c) 2015-2020 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>Safe1(c) 2018-2020 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>Safe=>?UV9u leancheckA generic implementation of  for instances of .Use it to define your  instances like so: 3instance Listable MyType where list = genericListConsider using v6 instead of this (unless you know what you're doing).v leancheckA generic implementation of  for instances of .Use it to define your  instances like so: 5instance Listable MyType where tiers = genericTiersuvuv(c) 2015-2020 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>SafeL leancheck&Checks a property printing results on  > check $ \xs -> sort (sort xs) == sort (xs::[Int]) +++ OK, passed 200 tests. > check $ \xs ys -> xs `union` ys == ys `union` (xs::[Int]) *** Failed! Falsifiable (after 4 tests): [] [0,0] leancheckDCheck a property for a given number of tests printing results on  V> checkFor 1000 $ \xs -> sort (sort xs) == sort (xs::[Int]) +++ OK, passed 1000 tests. leancheck(Check a property printing results on  and returning  on success. > p <- checkResult $ \xs -> sort (sort xs) == sort (xs::[Int]) +++ OK, passed 200 tests. > q <- checkResult $ \xs ys -> xs `union` ys == ys `union` (xs::[Int]) *** Failed! Falsifiable (after 4 tests): [] [0,0] > p && q FalseJThere is no option to silence this function: for silence, you should use . leancheckDCheck a property for a given number of tests printing results on  and returning  on success. a> checkResultFor 1000 $ \xs -> sort (sort xs) == sort (xs::[Int]) +++ OK, passed 1000 tests. TrueJThere is no option to silence this function: for silence, you should use .(c) 2017-2020 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>Safe~  leancheck Prints statistics about a given , generator up to a number of test values.SFor example, to know the distribution of the length of generated lists, just run: > classStats 100 (length :: [Int] -> Int) 0: 1/100 1% 1: 6/100 6% 2: 16/100 16% 3: 25/100 25% 4: 26/100 26% 5: 18/100 18% 6: 7/100 7% 7: 1/100 1%This provides similar functionality to QuickCheck's label, collect, classify and tabulate while keeping statistics separate from your properties. leancheckSame as , but separated by .6The first argument is the number of tiers to evaluate. > classStatsT 6 (length :: [Int] -> Int) tot 0 1 2 3 4 5 tot: 32 1 1 2 4 8 16 0: 1 1 0 0 0 0 0 1: 5 0 1 1 1 1 1 2: 10 0 0 1 2 3 4 3: 10 0 0 0 1 3 6 4: 5 0 0 0 0 1 4 5: 1 0 0 0 0 0 1$Lines are values, columns are tiers: > classStatsT 6 and tot 0 1 2 3 4 5 tot: 63 1 2 4 8 16 32 True: 6 1 1 1 1 1 1 False: 57 0 1 3 7 15 31 leancheck3How many values match each of a list of conditions?)How many odd and even numbers are in the  enumeration? i> conditionStats 1000 [("odd", odd :: Int -> Bool), ("even", even)] odd: 500/1000 50% even: 500/1000 50%,How many of the generated lists are ordered? S> conditionStats 1000 [("ordered", ordered :: [Int] -> Bool)] ordered: 131/1000 13% leancheckSame as  but by tier.6The first argument is the number of tiers to evaluate./How many odd and even numbers are in each tier? > conditionStatsT 10 [("odd", odd :: Int -> Bool), ("even", even)] total: 1 1 1 1 1 1 1 1 1 1 odd: 0 1 1 0 0 1 1 0 0 1 even: 1 0 0 1 1 0 0 1 1 0(How many ordered lists are in each tier? > conditionStatsT 10 [("ordered", ordered :: [Int] -> Bool)] total: 1 1 2 4 8 16 32 64 128 256 ordered: 1 1 2 3 5 7 11 15 22 30 leancheckClassify values using their  instance. ,> classify [1,2,3,1,2,1] [[1,1,1],[2,2],[3]](cf. , ) leancheck/Classify values by a given comparison function. ]> classifyBy (\(x,_) (y,_) -> x == y) [(1,1),(1,2),(2,1),(2,2)] [[(1,1),(1,2)],[(2,1),(2,2)]](cf. , ) leancheck8Classify values based on the result of a given function. X> classifyOn head ["sheep", "chip", "ship", "cheap"] [["sheep","ship"],["chip","cheap"]] 0> classifyOn odd [1,2,3,4,5,6] [[1,3,5],[2,4,6]](cf. , ) leancheck+Returns the counts of each value in a list. 8> counts "Mississippi" [('M',1),('i',4),('s',4),('p',2)]-Values are returned in the order they appear. leancheckPReturns the counts of each value in a list using a given comparison function. leancheckDReturns the counts of each value in a list based on a projection. X> countsOn length ["sheep", "chip", "ship", "cheap", "Mississippi"] [(5,2),(4,2),(11,1)] leancheck;Fits a list to a certain width by appending a certain value fit ' ' 6 "str" == "str "  fit 0 6 [1,2,3] == [1,2,3,0,0,0] leancheck:normalize makes all list the same length by adding a value @normalize ["asdf","qw","er"] == normalize ["asdf","qw ","er "] leancheck0Given a list of lists returns the maximum length (c) 2015-2020 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>Safe+ leancheck[Given a constructor that takes a list, return tiers of applications of this constructor./This is basically a type-restricted version of . You should use 6 instead: this serves more as an illustration of how  and  work (see source). leancheckqGiven 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 leancheckqGiven a constructor that takes a set of elements (as a list), lists tiers of applications of this constructor.A naive  instance for the  (of Data.Set) would read: Sinstance Listable a => Listable (Set a) where tiers = cons0 empty \/ cons2 insertThe above instance has a problem: it generates repeated sets. A more efficient implementation that does not repeat sets is given by:  tiers = setCons fromListAlternatively, you can use  direclty. leancheckxGiven a constructor that takes a map of elements (encoded as a list), lists tiers of applications of this constructorSo long as the underlying H enumerations have no repetitions, this will generate no repetitions.4This allows defining an efficient implementation of ' that does not repeat maps given by:  tiers = mapCons fromList leancheckvGiven a constructor that takes a list with no duplicate elements, return tiers of applications of this constructor. leancheckLike   but lifted over a  value.Only a  value will be returned. leancheckLike  but lifted over a  result. This discard  values. Only  values are returned. leancheckLike  but lifted over a  result. This discard  values. Only  values are returned.;Useful when declaring generators which have pre-conditions: data Fraction = Fraction Int Int mkFraction _ 0 = Nothing mkFraction n d = Fraction n d instance Listable Fraction where tiers = maybeCons2 mkFraction leancheckLike , but over 3 lists of tiers. leancheckLike , but over 3 lists of tiers. leancheck@Take the product of lists of tiers by a function returning a  value discarding  values. leancheckbTakes as argument tiers of element values; returns tiers of pairs with distinct element values..When argument tiers have no repeated elements: 9distinctPairs xss = xss >< xss `suchThat` uncurry (/=) leancheck by a given function: 6distinctPairsWith f = mapT (uncurry f) . distinctPairs leancheckTakes as argument tiers of element values; returns tiers of unordered pairs where, in enumeration order, the first element is less than or equal to the second.The name of this function is perhaps a misnomer. But in mathematics, an unordered pair is a pair where you don't care about element order, e.g.:  (1,2) = (2,1)r. This function will enumerate canonical versions of such pairs where the first element is less than the second.AThe returned element pairs can be seen as bags with two elements."When argument tiers are listed in : 9distinctPairs xss = xss >< xss `suchThat` uncurry (<=) leancheck by a given function: 8unorderedPairsWith f = mapT (uncurry f) . unorderedPairs leancheckTakes as argument tiers of element values; returns tiers of unordered pairs where, in enumeration order, the first element is strictly less than the second.AThe returned element pairs can be seen as sets with two elements."When argument tiers are listed in : 8distinctPairs xss = xss >< xss `suchThat` uncurry (<) leancheck by a given function: HunorderedDistinctPairsWith f = mapT (uncurry f) . unorderedDistinctPairs leancheckQTakes 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]] , ... ] leancheckCTakes 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 leancheck3Delete the first occurence of an element in a tier.GFor normalized lists-of-tiers without repetitions, the following holds: ,deleteT x = normalizeT . (`suchThat` (/= x)) leancheckUNormalizes tiers by removing up to 12 empty tiers from the end of a list of tiers. qnormalizeT [xs0,xs1,...,xsN,[]] = [xs0,xs1,...,xsN] normalizeT [xs0,xs1,...,xsN,[],[]] = [xs0,xs1,...,xsN]wThe arbitrary limit of 12 tiers is necessary as this function would loop if there is an infinite trail of empty tiers. leancheckConcatenate tiers of maybes leancheckLike  but for tiers. leancheck,Discard elements _not_ matching a predicate. +discardT odd [[1],[2,3],[4]] = [[],[2],[4]] leancheckYDiscard later elements maching a binary predicate (in relation to an earlier element). discardLaterT (>) [[0],[1],[-1],[2],[-2],...] = [[0],[],[-1],[],[-2],...] discardLaterT (==) [[0],[0,1],[0,1,2],[0,1,2,3],...] = [[0],[1],[2],[3]]VThis function is quite innefficient, use with care. Consuming the n-th element takes O(n^2) operations. leancheckRemoves repetitions from tiers. ~nubT [[0],[0,1],[0,1,2],[0,1,2,3],...] = [[0],[1],[2],[3],...] nubT [[0],[-1,0,1],[-2,-1,0,1,2],...] = [[0],[-1,1],[-2,2],...]!Consuming the n-th element takes O(n^2) operations. leancheck_Takes as argument tiers of element values; returns tiers of lists with no repeated elements. vnoDupListsOf [[0],[1],[2],...] == [ [[]] , [[0]] , [[1]] , [[0,1],[1,0],[2]] , [[0,2],[2,0],[3]] , ... ] leancheckwTakes 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]] , ... ] leancheckqTakes 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  instances. For  (from Data.Set), we would have: Tinstance Listable a => Listable (Set a) where tiers = mapT fromList $ setsOf tiers leancheckTakes as arguments tiers of source and target values; returns tiers of maps from the source to the target encoded as lists without repetition. leancheckTLists tiers of choices. Choices are pairs of values and tiers excluding that value. choices [[False,True]] == [[(False,[[True]]),(True,[[False]])]] choices [[1],[2],[3]] == [ [(1,[[],[2],[3]])] , [(2,[[1],[],[3]])] , [(3,[[1],[2],[]])] ].Each choice is sized by the extracted element. leancheckLike , but allows a custom function. leancheckLike M but lists tiers of non-decreasing (ascending) choices. Used to construct  values. MbagChoices [[False,True]] = [ [(False,[[False,True]]), (True,[[True]])] ] ~bagChoices [[1],[2],[3],...] = [ [(1,[[1],[2],[3],...])] , [(2,[[ ],[2],[3],...])] , [(3,[[ ],[ ],[3],...])] , ... ] leancheckLike  but customized by a function. leancheckLike E but lists tiers of strictly ascending choices. Used to construct  values. setChoices [[False,True]] == [[(False,[[True]]),(True,[[]])]] setChoices [[1],[2],[3]] == [ [(1,[[],[2],[3]])] , [(2,[[],[],[3]])] , [(3,[[],[],[]])] ] leancheckLike  but customized by a function. leancheckTakes 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]] , ... ] leancheckgShows a list of strings, one element per line. The returned string _does not_ end with a line break. listLines [] = "[]" listLines ["0"] = "[0]" listLines ["0","1"] = "[ 0\n\ \, 1\n\ \]"  leancheck\Shows a list, one element per line. The returned string _does not_ end with a line break. slistLines [] = "[]" listLines [0] = "[0]" listLines [0,1] = "[ 0\n\ \, 1\n\ \]"! leancheck Shows a list of strings, adding ...- to the end when longer than given length. dotsLongerThan 3 ["1","2"] = [1,2] dotsLongerThan 3 ["1","2","3","4"] = [1,2,3,...] dotsLongerThan 5 $ map show [1..] = [1,2,3,4,5,...] leancheckAlternative to " for ? with one element per line. (useful for debugging, see also ).0This function can be useful when debugging your  instances. leancheckAlternative to # for ? with one element per line. (useful for debugging, see also ). x> printTiers 3 (tiers :: [[Int]]) [ [0] , [1] , [-1] , ... ] > printTiers 3 (tiers :: [[Bool]]) [ [ False , True ] ]0This function can be useful when debugging your  instances. leancheck$Checks if a list-of-tiers is finite.*Warning:** this is just an approximation, a list-of-tiers is considered finite if it has less than 13 values. This function may give false negatives.%%(c) 2015-2020 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>None@  !"#56789:;<=oq@ !"# 56789:;<= oq (c) 2015-2020 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>None& leancheckPGiven tiers of argument and result values, return tiers of functional values. leancheckGiven tiers of input values and tiers of output values, return tiers with all possible lists of input-output pairs. These represent functional relations. In the implementation of E, they represent exceptions to a constant function, hence the name .$ leancheck1Returns tiers of sets excluding the universe set. oincompleteSetsOf (tiers :: [[Bool]]) = [[],[[False],[True]],[]] incompleteSetsOf (tiers :: [[()]]) = [[]]This is the same as  on types with infinite values: AincompleteSetsOf (tiers :: [[Int]]) = setsOf (tiers :: [[Int]]) (c) 2015-2020 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>None(X(c) 2015-2020 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>None* (c) 2015-2020 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>NoneD% leancheckrTakes a value and a function. Ignores the value. Binds the argument of the function to the type of the value. leancheckTransforms a value into  that value or  on some errors:ArithExceptionArrayException ErrorCallPatternMatchFail !> errorToNothing False Just False "> errorToNothing (0 :: Int) Just 0 *> errorToNothing (undefined :: ()) NothingThis function uses &. leancheckTransforms a value into  that value or  on error. leancheckTransforms errors into ' values. > errorToFalse False False > errorToFalse True True > errorToFalse undefined FalseThis functions uses &. leancheckTransforms errors into  values. > errorToTrue False False > errorToTrue True True > errorToTrue undefined TrueThis functions uses &. leancheck'Transforms errors into a default value. > fromError 0 (15 :: Int) 15 "> fromError 0 (undefined :: Int) 0 leancheckAn error-catching version of  that returns ' in case of errors. prop_cannot_be_seven :: Int -> Bool prop_cannot_be_seven 7 = error "Argument cannot be seven" prop_cannot_be_seven _ = True `> import Test.LeanCheck > holds 100 prop_cannot_be_seven *** Exception: Argument cannot be seven D> import Test.LeanCheck.Error > holds 100 prop_cannot_be_seven False leancheckAn error-catching version of  that returns  in case of errors. leancheckAn error-catching version of . leancheckAn error-catching version of  . leancheckAn error-catching version of !. leancheckAn error-catching version of ". leancheckAn error-catching version of #. leancheckAn error-catching version of $.E #56789:;<=oqE #56789:;<=oq (c) 2015-2020 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>NoneK8 leancheck6Allows building equality properties between functions. %prop_id_idempotent = id === id . id /> check $ id === (+0) +++ OK, passed 200 tests. <> check $ id === id . id +++ OK, passed 1 tests (exhausted). @> check $ id === (+1) *** Failed! Falsifiable (after 1 tests): 0 leancheckCAllows building equality properties between two-argument functions. &> holds 100 $ const ==== asTypeOf True $> holds 100 $ (+) ==== flip (+) True  > holds 100 $ (+) ==== (*) False leancheckAnd ((() operator over one-argument properties.<Allows building conjuntions between one-argument properties: 3> holds 100 $ id === (+0) &&& id === (id . id) True leancheckAnd ((() operator over two-argument properties.<Allows building conjuntions between two-argument properties: 7> holds 100 $ (+) ==== flip (+) &&&& (+) ==== (*) False leancheck,And operator over three-argument properties. leancheckOr ()() operator over one-argument properties.=Allows building disjunctions between one-argument properties: 3> holds 100 $ id === (+0) ||| id === (id . id) True leancheckOr ()() operator over two-argument properties.<Allows building conjuntions between two-argument properties: 6> holds 100 $ (+) ==== flip (+) |||| (+) ==== (*) True leancheck"Is a given operator commutative?  x + y = y + x 5> check $ isCommutative (+) +++ OK, passed 200 tests. {> import Data.List > check $ isCommutative (union :: [Int]->[Int]->[Int]) *** Failed! Falsifiable (after 4 tests): [] [0,0] leancheck"Is a given operator associative? x + (y + z) = (x + y) + z 5> check $ isAssociative (+) +++ OK, passed 200 tests. J> check $ isAssociative (-) *** Failed! Falsifiable (after 2 tests): 0 0 1 leancheck:Does the first operator, left-distributes over the second?This is an alias to . leancheck>Does the first operator, left-distributes over the second? x * (y + z) = (x * y) + (x * z) D> check $ (*) `isLeftDistributiveOver` (+) +++ OK, passed 200 tests. Y> check $ (+) `isLeftDistributiveOver` (*) *** Failed! Falsifiable (after 8 tests): 1 0 1 leancheck?Does the first operator, right-distributes over the second? (y + z) * x = (y * x) + (z * x) E> check $ (*) `isRightDistributiveOver` (+) +++ OK, passed 200 tests. Z> check $ (+) `isRightDistributiveOver` (*) *** Failed! Falsifiable (after 8 tests): 1 0 1 leancheckAre two operators  ped versions of each other? O> check $ ((<) `isFlipped` (>) :: Int -> Int -> Bool) +++ OK, passed 200 tests. Q> check $ ((<=) `isFlipped` (>=) :: Int -> Int -> Bool) +++ OK, passed 200 tests. c> check $ ((<) `isFlipped` (>=) :: Int -> Int -> Bool) *** Failed! Falsifiable (after 1 tests): 0 0 c> check $ ((<=) `isFlipped` (>) :: Int -> Int -> Bool) *** Failed! Falsifiable (after 1 tests): 0 0 leancheckIs a given relation transitive?KA relation is transitive when if a is related to b then b is related to c. I> check $ isTransitive ((==) :: Int->Int->Bool) +++ OK, passed 200 tests. ^> check $ isTransitive ((/=) :: Int->Int->Bool) *** Failed! Falsifiable (after 3 tests): 0 1 0 leancheckIs a given relation reflexive?EA relation is reflexive when an element is always related to itself. H> check $ isReflexive ((==) :: Int->Int->Bool) +++ OK, passed 200 tests. Y> check $ isReflexive ((/=) :: Int->Int->Bool) *** Failed! Falsifiable (after 1 tests): 0 leancheck Is a given relation irreflexive?`A given relation is irreflexive or anti-reflexive when an element is _never_ related to itself.This is not the negation of . [> check $ isIrreflexive ((==) :: Int->Int->Bool) *** Failed! Falsifiable (after 1 tests): 0 J> check $ isIrreflexive ((/=) :: Int->Int->Bool) +++ OK, passed 200 tests. leancheckIs a given relation symmetric?KA relation is symmetric when if a is related to b, then b is related to a. >> check $ isSymmetric (&&) +++ OK, passed 4 tests (exhausted). O> check $ isSymmetric (==>) *** Failed! Falsifiable (after 2 tests): False True%This is a type-restricted version of . leancheck"Is a given relation antisymmetric?Not to be confused with +. Not to be confused with the negation of . L> check $ isAntisymmetric ((<=) :: Int->Int->Bool) +++ OK, passed 200 tests. _> check $ isAntisymmetric ((/=) :: Int->Int->Bool) *** Failed! Falsifiable (after 2 tests): 0 1 leancheckIs a given relation asymmetric?Not to be confused with not  and . \> check $ isAsymmetric ((<=) :: Int->Int->Bool) *** Failed! Falsifiable (after 1 tests): 0 0 H> check $ isAsymmetric ((<) :: Int->Int->Bool) +++ OK, passed 200 tests. leancheck,Is the given binary relation an equivalence?KIn other words, is the given relation reflexive, symmetric and transitive? S> check (isEquivalence (==) :: Int -> Int -> Int -> Bool) +++ OK, passed 200 tests. h> check (isEquivalence (<=) :: Int -> Int -> Int -> Bool) *** Failed! Falsifiable (after 3 tests): 0 1 0 Or, using  Test.LeanCheck.Utils.TypeBinding: S> check $ isEquivalence (<=) -:> int *** Failed! Falsifiable (after 3 tests): 0 1 0 leancheck-Is the given binary relation a partial order?OIn other words, is the given relation reflexive, antisymmetric and transitive? _> check $ isPartialOrder ((<) :: Int->Int->Bool) *** Failed! Falsifiable (after 1 tests): 0 0 0 K> check $ isPartialOrder ((<=) :: Int->Int->Bool) +++ OK, passed 200 tests. => check $ isPartialOrder isSubsetOf +++ OK, passed 200 tests. leancheck4Is the given binary relation a strict partial order?NIn other words, is the given relation irreflexive, asymmetric and transitive? P> check $ isStrictPartialOrder ((<) :: Int->Int->Bool) +++ OK, passed 200 tests. f> check $ isStrictPartialOrder ((<=) :: Int->Int->Bool) *** Failed! Falsifiable (after 1 tests): 0 0 0 leancheck+Is the given binary relation a total order? > check $ isTotalOrder ((<) :: Int->Int->Bool) *** Failed! Falsifiable (after 1 tests): 0 0 0 > check $ isTotalOrder ((<=) :: Int->Int->Bool) +++ OK, passed 200 tests. leancheck2Is the given binary relation a strict total order? d> check $ isStrictTotalOrder ((<=) :: Int->Int->Bool) *** Failed! Falsifiable (after 1 tests): 0 0 0 N> check $ isStrictTotalOrder ((<) :: Int->Int->Bool) +++ OK, passed 200 tests. leancheckDoes the given *) function follow the required properties?"This is useful for testing custom  instances. P> check $ isComparison (compare :: Int->Int->Ordering) +++ OK, passed 200 tests. leancheck"Is the given function idempotent?  f (f x) == x 4> check $ isIdempotent abs +++ OK, passed 200 tests. 5> check $ isIdempotent sort +++ OK, passed 200 tests. H> check $ isIdempotent negate *** Failed! Falsifiable (after 2 tests): 1 leancheck#Is the given function an identity? f x == x 3> check $ isIdentity (+0) +++ OK, passed 200 tests. C> check $ isIdentity (sort :: [()]->[()]) +++ OK, passed 200 tests. D> check $ isIdentity (not . not) +++ OK, passed 2 tests (exhausted). leancheck)Is the given function never an identity? f x /= x ?> check $ neverIdentity not +++ OK, passed 2 tests (exhausted). I> check $ neverIdentity negate *** Failed! Falsifiable (after 1 tests): 0+Note: this is not the same as not being an . leancheckIs this  instance valid?'This is useful for testing your custom ( instances against required properties.)In particular, this function tests that + is an equivalence and that , is the negation of +. G> check $ (okEq :: Int -> Int -> Int -> Bool) +++ OK, passed 200 tests. T> check $ (okEq :: Bool -> Bool -> Bool -> Bool) +++ OK, passed 8 tests (exhausted). leancheckIs this  instance valid?'This is useful for testing your custom ( instances against required properties. H> check $ (okOrd :: Int -> Int -> Int -> Bool) +++ OK, passed 200 tests. U> check $ (okOrd :: Bool -> Bool -> Bool -> Bool) +++ OK, passed 8 tests (exhausted). leancheckIs this  and  instance valid and consistent?'This is useful for testing your custom  and ( instances against required properties. J> check $ (okEqOrd :: Int -> Int -> Int -> Bool) +++ OK, passed 200 tests. W> check $ (okEqOrd :: Bool -> Bool -> Bool -> Bool) +++ OK, passed 8 tests (exhausted). leancheckLike & but restricted to zero and positives. ]> check (okNumNonNegative :: Natural -> Natural -> Natural -> Bool) +++ OK, passed 200 tests. leancheckIs this - instance valid?'This is useful for testing your custom -( instances against required properties. F> check (okNum :: Int -> Int -> Int -> Bool) +++ OK, passed 200 tests. Double is mostly valid, but not entirely valid: ^> check (okNum :: Double -> Double -> Double -> Bool) *** Failed! Falsifiable (after 6 tests): 0 0.0 Infinity leancheck8Equal under, a ternary operator with the same fixity as +. x =$ f $= y = f x == f y ,> [1,2,3,4,5] =$ take 2 $= [1,2,4,8,16] True -> [1,2,3,4,5] =$ take 3 $= [1,2,4,8,16] False !> [1,2,3] =$ sort $= [3,2,1] True  > 42 =$ (`mod` 10) $= 16842 True !> 42 =$ (`mod` 9) $= 16842 False > 'a' =$ isLetter $= 'b' True > 'a' =$ isLetter $= '1' False leancheckSee  leancheck!Check if two lists are equal for n1 values. This operator has the same fixity of +. (xs =| n |= ys = take n xs == take n ys V[1,2,3,4,5] =| 2 |= [1,2,4,8,16] -- > True [1,2,3,4,5] =| 3 |= [1,2,4,8,16] -- > False leancheckSee  leancheckDeprecated: use . leancheckDeprecated: use . leancheckDeprecated: use . leancheckDeprecated: use . leancheckDeprecated: use . leancheckDeprecated: use . leancheckDeprecated: use . leancheckDeprecated: use . leancheckDeprecated: use . leancheckDeprecated: use . leancheckDeprecated: use . leancheckDeprecated: use . leancheckDeprecated: use . leancheckDeprecated: use . leancheckDeprecated: use . leancheckDeprecated: use . leancheckDeprecated: use . leancheckDeprecated: use . leancheckDeprecated: use .9#9# 44333224444 (c) 2015-2020 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>None., leancheckStrings of letters leancheck"Strings of alphanumeric characters leancheckStrings of digits. leancheck Strings of alphabetic characters  leancheckStrings of uppercase characters  leancheck Strings of lowercase characters. leancheckStrings of spaces. leancheckAlphabetic characters.  list :: [Letter] = "aAbBcC..." H> check $ \(Letter c) -> isLetter c +++ OK, passed 52 tests (exhausted).Equivalent to . leancheckAlphanumeric characters. &list :: [AlphaNum] = "0a1A2b3B4c..." L> check $ \(AlphaNum c) -> isAlphaNum c +++ OK, passed 62 tests (exhausted). leancheckDigits.  list :: [Digit] = "0123456789" F> check $ \(Digit c) -> isDigit c +++ OK, passed 10 tests (exhausted). leancheckAlphabetic characters. list :: [Alpha] = "aAbBcC..." F> check $ \(Alpha c) -> isAlpha c +++ OK, passed 52 tests (exhausted).Equivalent to . leancheckUppercase characters. list :: [Upper] = "ABCDEF..." F> check $ \(Upper c) -> isUpper c +++ OK, passed 26 tests (exhausted).! leancheckLowercase characters. list :: [Lower] = "abcdef..." F> check $ \(Lower c) -> isLower c +++ OK, passed 26 tests (exhausted).$ leancheckSpace characters. !list :: [Space] = " \t\n\r\f\v" E> check $ \(Space c) -> isSpace c +++ OK, passed 6 tests (exhausted).' leancheck>Wrap around lists of integers for an enumeration containing e-)-treme integer values. ^> check $ \xs -> all (>=0) xs ==> sum (take 1 xs :: [Int]) <= sum xs +++ OK, passed 200 tests. > check $ \(Xs xs) -> all (>=0) xs ==> sum (take 1 xs :: [Int]) <= sum xs *** Failed! Falsifiable (after 56 tests): [1,9223372036854775807]) leancheck)2 type to be wrapped around integer types for an e-)(-treme integer enumeration. See the  instance for ). Use )9 when testing properties about overflows and the like: <> check $ \x -> x + 1 > (x :: Int) +++ OK, passed 200 tests. c> check $ \(X x) -> x + 1 > (x :: Int) +++ Failed! Falsifiable (after 4 tests): 9223372036854775807, leancheck)Lists of pairs representing maps. The  ) enumeration will not have repeated maps. e> take 6 (list :: [Map Nat Nat]) [Map [],Map [(0,0)],Map [(0,1)],Map [(1,0)],Map [(0,2)],Map [(1,1)]]. leancheck Lists representing sets. The  ) enumeration will not have repeated sets. Q> take 6 (list :: [Set Nat]) [Set [],Set [0],Set [1],Set [0,1],Set [2],Set [0,2]]0 leancheck,Lists representing bags (multisets). The  ) enumeration will not have repeated bags. U> take 6 (list :: [Bag Nat]) [Bag [],Bag [0],Bag [0,0],Bag [1],Bag [0,0,0],Bag [0,1]] See also: % and .2 leancheck Lists without repeated elements. _> take 6 $ list :: [NoDup Nat] [NoDup [],NoDup [0],NoDup [1],NoDup [0,1],NoDup [1,0],NoDup [2]]$Example, checking the property that nub is an identity: import Data.List (nub) > check $ \xs -> nub xs == (xs :: [Int]) *** Failed! Falsifiable (after 3 tests): [0,0] > check $ \(NoDup xs) -> nub xs == (xs :: [Int]) +++ OK, passed 200 tests.4 leancheckDeprecated. Use S.5 leancheckDeprecated. Use V.6 leancheckDeprecated. Use Y.7 leancheckDeprecated. Use \.8 leancheck-Natural numbers modulo 7: 0, 1, 2, 3, 4, 5, 6; leancheck*Natural numbers modulo 6: 0, 1, 2, 3, 4, 5> leancheck'Natural numbers modulo 5: 0, 1, 2, 3, 4A leancheck$Natural numbers modulo 4: 0, 1, 2, 3D leancheck!Natural numbers modulo 3: 0, 1, 2G leancheckNatural numbers modulo 2: 0, 1J leancheckNatural numbers modulo 1: 0M leancheck:Natural numbers (including 0): 0, 1, 2, 3, 4, 5, 6, 7, ...+Internally, this type is represented as an . So, it is limited by the . of .Its /,  and -3 instances only produce non-negative values. When x < y then  x - y = 0.P leancheck:Natural numbers (including 0): 0, 1, 2, 3, 4, 5, 6, 7, ...+Internally, this type is represented as an 0. allowing for an infinity of possible values.Its /,  and -3 instances only produce non-negative values. When x < y then  x - y = 0.S leancheckQFour-bit unsigned integers: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15V leancheck3Three-bit unsigned integers: 0, 1, 2, 3, 4, 5, 6, 7Y leancheck%Two-bit unsigned integers: 0, 1, 2, 3\ leancheck!Single-bit unsigned integer: 0, 1_ leancheckQFour-bit signed integers: -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7b leancheck5Three-bit signed integers: -4, -3, -2, -1, 0, 1, 2, 3e leancheck%Two-bit signed integers: -2, -1, 0, 1h leancheck!Single-bit signed integers: -1, 01 leancheckLazily interleaves two lists, switching between elements of the two. This version uses the first list more frequently than the second. &[x,y,z,w] +| [a,b] == [x,y, a, z,w, b] leancheck>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 , ... ]  leancheckLists with elements of the ) type.n      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijnhijefgbcd_`a\]^YZ[VWXSTUMNOJKLGHIDEFABC>?@;<=89:PQR7654)*+'(2301./,-$%&!"#      15(c) 2015-2020 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>Noner!4^ leancheckvType restricted version of const that forces its first argument to have the same type as the second. A symnonym to 2:  value -: ty = value :: Ty Examples: P 10 -: int = 10 :: Int undefined -: 'a' >- 'b' = undefined :: Char -> Char_ leancheckvType restricted version of const that forces the argument of its first argument to have the same type as the second: - f -:> ty = f -: ty >- und = f :: Ty -> aExample: 9 abs -:> int = abs -: int >- und = abs :: Int -> Int` leanchecktType restricted version of const that forces the result of its first argument to have the same type as the second. - f ->: ty = f -: und >- ty = f :: a -> Tya leancheck}Type restricted version of const that forces the second argument of its first argument to have the same type as the second. :f ->:> ty = f -: und -> ty -> und = f :: a -> Ty -> bb leancheckType restricted version of const that forces the result of the result of its first argument to have the same type as the second. :f ->>: ty = f -: und -> und -> ty = f :: a -> b -> Tyc leancheck|Type restricted version of const that forces the third argument of its first argument to have the same type as the second.d leancheckType restricted version of const that forces the result of the result of the result of its first argument to have the same type as the second.e leancheckForces the 4th argument type.f leancheck0Forces the result type of a 4-argument function.g leancheckForces the 5th argument type.h leancheck0Forces the result type of a 5-argument function.i leancheckForces the 6th argument type.j leancheck0Forces the result type of a 6-argument function.k leancheckForces the 7th argument type.l leancheck0Forces the result type of a 7-argument function.m leancheckForces the 8th argument type.n leancheck0Forces the result type of a 8-argument function.o leancheckForces the 9th argument type.p leancheck0Forces the result type of a 9-argument function.q leancheck%Forces the type of the 10th argument.r leancheck1Forces the result type of a 10-argument function.s leancheck%Forces the type of the 11th argument.t leancheck1Forces the result type of a 11-argument function.u leancheck%Forces the type of the 12th argument.v leancheck1Forces the result type of a 12-argument function.w leancheckReturns an undefined functional value that takes an argument of the type of its first argument and return a value of the type of its second argument. $ty >- ty = (undefined :: Ty -> Ty) Examples: r'a' >- 'b' = char >- char = (undefined :: Char -> Char) int >- bool >- int = undefined :: Int -> Bool -> Intx leancheckShorthand for undefinedy leancheck Undefined + value for use with type binding operators. )check $ (\x y -> x + y == y + x) ->:> intz leancheck Undefined 0+ value for use with type binding operators. -check $ (\x y -> x + y == y + x) ->:> integer{ leancheck Undefined + value for use with type binding operators.| leancheck Undefined + value for use with type binding operators.} leancheck Undefined 3+ value for use with type binding operators.~ leancheck Undefined 4 value. leancheck Undefined 5 value. leancheck Undefined 6 value. leancheck Undefined 7 value. leancheck Undefined h value. Uses the type of the given value as the argument type. For use with type binding operators.5To check a property with the first argument bound to  , do: check $ prop -:> mayb int leancheck Undefined 8k value. Uses the types of the given values as the argument types. For use with type binding operators. leancheck Undefined P value. leancheck Undefined M value. leancheck Undefined h value. leancheck Undefined e value. leancheck Undefined b value. leancheck Undefined _ value. leancheck Undefined \ value. leancheck Undefined Y value. leancheck Undefined V value. leancheck Undefined S value. leancheckDeprecated. Use . leancheckDeprecated. Use . leancheckDeprecated. Use . leancheckDeprecated. Use .4^_`abcdefghijklmnopqrstuvwxyz{|}~4^_`abcdefghijklmnopqrstuvxw~yz{|}^1_1`1a1b1c1d1e1f1g1h1i1j1k1l1m1n1o1p1q1r1s1t1u1v1w9 &(c) 2015-2020 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>Nonew\#      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij^_`abcdefghijklmnopqrstuvwxyz{|}~(c) 2015-2020 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>None leancheckK values are those for which we can return a list of functional bindings.Instances for ",able algebraic datatypes are defined using : 8instance ShowFunction Ty where bindtiers = bindtiersShow leancheckA functional binding in a showable format. Argument values are represented as a list of strings. The result value is represented by  a 6 when defined or by  when 9. leancheckGiven a  value, return a list of bs. If the domain of the given argument function is infinite, the resulting list is infinite.PSome examples follow. These are used as running examples in the definition of ,  and .)Defined return values are represented as  6s: "> bindings True [([],Just "True")]+Undefined return values are represented as Nothing: #> bindings undefined [([],Nothing)]5Infinite domains result in an infinite bindings list: _> bindings (id::Int->Int) [ (["0"], Just "0") , (["1"], Just "1") , (["-1"], Just "-1") , ... ]0Finite domains result in a finite bindings list: > bindings (&&) [ (["False","False"], Just "False") , (["False","True"], Just "False") , (["True","False"], Just "False") , (["True","True"], Just "True") ] > bindings (||) [ (["False","False"], Just "False") , (["False","True"], Just "True") , (["True","False"], Just "True") , (["True","True"], Just "True") ]KEven very simple functions are represented by an infinite list of bindings: a> bindings (== 0) [ (["0"], Just "True") , (["1"], Just "False") , (["-1"], Just "False") , ... ] a> bindings (== 1) [ (["0"], Just "False") , (["1"], Just "True") , (["-1"], Just "False") , ... ]#Ignored arguments are still listed: > bindings ((\_ y -> y == 1) :: Int -> Int -> Bool) [ (["0","0"], Just "False") , (["0","1"], Just "True") , (["1","0"], Just "False") , ... ]+Again, undefined values are represented as . Here, the : of an empty list is undefined: > bindings (head :: [Int] -> Int) [ (["[]"], Nothing) , (["[0]"], Just "0") , (["[0,0]"], Just "0") , (["[1]"], Just "1") , ... ] leancheckA drop-in implementation of  for " able types.Define instances for "able algebraic datatypes as: 8instance ShowFunction Ty where bindtiers = bindtiersShow leancheck.Given the number of patterns to show, shows a  value. > putStrLn $ showFunction undefined True True > putStrLn $ showFunction 3 (id::Int->Int) \x -> case x of 0 -> 0 1 -> 1 -1 -> -1 ... > putStrLn $ showFunction 4 (&&) \x y -> case (x,y) of (True,True) -> True _ -> False In the examples above, "..."" should be interpreted literally.)This can be used as an implementation of " for functions: Zinstance (Show a, Listable a, ShowFunction b) => Show (a->b) where show = showFunction 8See ( for an alternative without line breaks. leancheckSame as , but has no line breaks. > putStrLn $ showFunctionLine 3 (id::Int->Int) \x -> case x of 0 -> 0; 1 -> 1; -1 -> -1; ... > putStrLn $ showFunctionLine 3 (&&) \x y -> case (x,y) of (True,True) -> True; _ -> False)This can be used as an implementation of " for functions: Zinstance (Show a, Listable a, ShowFunction b) => Show (a->b) where show = showFunction 8; leancheck_isUndefined checks if a function is totally undefined for the given maximum number of values< leancheckJchecks if a function is constant for the given maximum number of values= leancheckshows a constant function leancheckTReturns a set of variables and a set of bindings describing how a function works.)Some argument values are generalized to "_" when possible. If one of the function arguments is not used altogether, it is ommited in the set of bindings and appears as "_" in the variables list. This is the last( function in the clarification pipeline.It takes two integer arguments: mG: the maximum number of cases considered for computing the description;n8: the maximum number of cases in the actual description. As a general rule of thumb, set m=n*n+1.Some examples follow:7When all arguments are used, the result is the same as : d> clarifiedBindings 100 10 (==1) ( ["x"], [ (["1"],Just "True"), , (["_"],Just "False") ] )ZWhen some arguments are unused, they are omitted in the list of bindings and appear as "_" in the list of variables. x> clarifiedBindings 100 10 (\_ y -> y == 1) ( ["_", "y"], [ (["1"],Just "True") , (["_"],Just "False") ] ) leancheckeReturns a set of bindings describing how a function works. Some argument values are generalized to "_1" when possible. It takes two integer arguments: mC: the maximum number of cases considered for computing description;n8: the maximum number of cases in the actual description. As a general rule of thumb, set m=n*n+1. This is the second( function in the clarification pipeline.&This function processes the result of a to sometimes return shorter descriptions. It chooses the shortest of the following (in order): regular unexplained-undescribed ;regular ;. with least occurring cases generalized first;Here are some examples:$Sometimes the result is the same as : ^> describedBindings 100 10 (||) [ (["False","False"],Just "False") , (["_","_"],Just "True") ] O> describedBindings 100 10 (==0) [ (["0"],Just "True") , (["_"],Just "False") ]\but sometimes it is shorter because we consider generalizing least occurring cases first: ^> describedBindings 100 10 (&&) [ ( ["True","True"],Just "True") , ( ["_","_"],Just "False") ] P> describedBindings 100 10 (==1) [ (["1"],Just "True"), , (["_"],Just "False") ] b> describedBindings 100 10 (\_ y -> y == 1) [ (["_","1"],Just "True") , (["_","_"],Just "False") ] leancheckgReturns a set of bindings explaining how a function works. Some argument values are generalized to "_q" when possible. It takes as argument the maximum number of cases considered for computing the explanation.A measure of success in this generalization process is if this function returns less values than the asked maximum number of cases. This is the first( function in the clarification pipeline.In some cases, 8 cannot be "explained" an almost unchanged result of D is returned with the last binding having variables replaced by "_": t> explainedBindings 4 (id::Int->Int) [ (["0"],Just "0") , (["1"],Just "1") , (["-1"],Just "-1") , (["_"],Just "2") ]0When possible, some cases are generalized using _: Z> explainedBindings 10 (||) [ (["False","False"],Just "False") , (["_","_"],Just "True") ]Hbut the resulting "explanation" might not be the shortest possible (cf. ): v> explainedBindings 10 (&&) [ ( ["False","_"],Just "False") , (["_","False"],Just "False") , (["_","_"],Just "True") ]:Generalization works for infinite domains (heuristically): K> explainedBindings 10 (==0) [ (["0"],Just "True") , (["_"],Just "False") ]MGeneralization for each item is processed in the order they are generated by A hence explanations are not always the shortest possible (cf. =). In the following examples, the first case is redundant. c> explainedBindings 10 (==1) [ (["0"],Just "False") , (["1"],Just "True"), , (["_"],Just "False") ] y> explainedBindings 10 (\_ y -> y == 1) [ (["_","0"],Just "False") , (["_","1"],Just "True") , (["_","_"],Just "False") ]> leancheck&Should be read as "is generalized by": > ["1","2","3"] <~ ["_","_","_"] True > ["_","_","_"] <~ ["1","2","3"] False > ["1","3"] <~ ["_","3"] True > ["_","3"] <~ ["_","4"] False? leancheck&Should be read as "is generalized by".  (c) 2015-2020 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>None leancheck*A single-line show instance for functions.This is intended to @ functions generated by the $ instance for functions defined in  Test.LeanCheck.Function.Listablez: functions that have finite exceptions to a constant function. It does work on other types of functions, albeit using "...". B> print (&&) \x y -> case (x,y) of (True,True) -> True; _ -> False D> print (==>) \x y -> case (x,y) of (True,False) -> False; _ -> True 3> print (==2) \x -> case x of 2 -> True; _ -> False V> print (\x -> abs x < 2) \x -> case x of 0 -> True; 1 -> True; -1 -> True; _ -> FalseWhen the function cannot be defined by finite exceptions to a constant function using 8 case-patterns, the rest of the function is represented by "...". W> print (+) \x y -> case (x,y) of (0,0) -> 0; (0,1) -> 1; (1,0) -> 1; (0,-1) -> -1; ...(c) 2015-2020 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>None leancheck)A multi-line show instance for functions.This is intended to @ functions generated by the $ instance for functions defined in  Test.LeanCheck.Function.Listablez: functions that have finite exceptions to a constant function. It does work on other types of functions, albeit using "...". Q> print (&&) \x y -> case (x,y) of (True,True) -> True _ -> False S> print (==>) \x y -> case (x,y) of (True,False) -> False _ -> True >> print (==2) \x -> case x of 2 -> True _ -> False k> print (\x -> abs x < 2) \x -> case x of 0 -> True 1 -> True -1 -> True _ -> FalseWhen the function cannot be defined by finite exceptions to a constant function using 8 case-patterns, the rest of the function is represented by "...". > print (+) \x y -> case (x,y) of (0,0) -> 0 (0,1) -> 1 (1,0) -> 1 (0,-1) -> -1 (1,1) -> 2 (-1,0) -> -1 (0,2) -> 2 (1,-1) -> 0 ...'(c) 2015-2020 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>None((c) 2015-2020 Rudy Matela$3-Clause BSD (see the file LICENSE) Rudy Matela <rudy@matela.com.br>NoneXA)*+,-./0123456789:;<=>?@ABC$" #!DEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~%    ! " # $                                         ! " " # $ $ % & & ' ( ( ) * * + , , - . . / 0 0 1 1 2 3 3   4 4 5 5 6 7 8 9 : : ; < < = > > ? @ @ A B B C D D E F F G H H I   J K K L M M N O O P Q Q R S S T U U V W W X Y Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                                                                                                                                   ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L MNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      ! "#$%&'()*+,-.-/012 3456789:;<=>?@ABCDE&leancheck-0.9.2-ChWQLwkENsEAA00rkzG0taTest.LeanCheck.CoreTest.LeanCheck.BasicTest.LeanCheck.DeriveTest.LeanCheck.Function.EqTest.LeanCheck.GenericTest.LeanCheck.IOTest.LeanCheck.StatsTest.LeanCheck.Tiers$Test.LeanCheck.Function.ListsOfPairs-Test.LeanCheck.Function.Listable.ListsOfPairsTest.LeanCheck.ErrorTest.LeanCheck.Utils.OperatorsTest.LeanCheck.Utils.Types Test.LeanCheck.Utils.TypeBinding$Test.LeanCheck.Function.ShowFunction&Test.LeanCheck.Function.Show.FourCases'Test.LeanCheck.Function.Show.EightLinesderiveListableGHCNatural System.IOstdoutTest.LeanCheckholdsData.SetSet Data.MaybemapMaybe Test.LeanCheck.Function.ListablefailsexistscounterExamplewitnesscounterExamples witnessesresultsbagsOfTest.LeanCheck.UtilsTest.LeanCheck.Function.ShowTest.LeanCheck.FunctionTestable resultiersListabletierslisttoTiers listIntegraltiersFractional tiersFloatingmapTfilterTconcatT concatMapTcons0cons1cons2cons3cons4cons5delayresetsuchThat+|\/\\//>< productWith==>$fListableOrdering$fListableDouble$fListableFloat $fListable[]$fListable(,,,,)$fListable(,,,)$fListable(,,) $fListable(,)$fListableEither$fListableMaybe$fListableBool$fListableChar$fListableInteger $fListableInt $fListable() $fTestable->$fTestableBoolcons6cons7cons8cons9cons10cons11cons12ofWeight addWeight$fListableSeekMode$fListableBufferMode$fListableIOMode$fListableGeneralCategory$fListableExitCode$fListableCSUSeconds$fListableCUSeconds$fListableCBool$fListableCDouble$fListableCFloat$fListableCTime$fListableCClock$fListableCUIntMax$fListableCIntMax$fListableCUIntPtr$fListableCIntPtr$fListableCULLong$fListableCLLong$fListableCSigAtomic$fListableCWchar$fListableCSize$fListableCPtrdiff$fListableCULong$fListableCLong$fListableCUInt$fListableCInt$fListableCUShort$fListableCShort$fListableCUChar$fListableCSChar$fListableCChar$fListableInt64$fListableInt32$fListableInt16$fListableInt8$fListableWord64$fListableWord32$fListableWord16$fListableWord8$fListableWord$fListableComplex$fListableRatio$fListable(,,,,,,,,,,,)$fListable(,,,,,,,,,,)$fListable(,,,,,,,,,)$fListable(,,,,,,,,)$fListable(,,,,,,,)$fListable(,,,,,,)$fListable(,,,,,)deriveListableIfNeededderiveListableCascading deriveTiers deriveList$fEq-> genericList genericTiers $fListable'M1$fListable'M10$fListable'M11$fListable'M12$fListable':*:$fListable':+: $fListable'K1 $fListable'U1 $fListable'V1checkcheckFor checkResultcheckResultFor $fEqResult $fShowResult classStats classStatsTconditionStatsconditionStatsTclassify classifyBy classifyOncountscountsBycountsOnlistConsbagConssetConsmapCons noDupListCons maybeCons0 maybeCons1 maybeCons2product3 product3WithproductMaybeWith distinctPairsdistinctPairsWithunorderedPairsunorderedPairsWithunorderedDistinctPairsunorderedDistinctPairsWithlistsOfproductsdeleteT normalizeT catMaybesT mapMaybeTdiscardT discardLaterTnubT noDupListsOfsetsOfmapschoices bagChoices setChoices listsOfLength showTiers printTiersfinite-->>exceptionPairs $fListable->errorToNothinganyErrorToNothing errorToFalse errorToTrue fromError=======&&&&&&&&&&&&||||||| isCommutative isAssociativeisDistributiveOverisLeftDistributiveOverisRightDistributiveOver isFlipped isTransitive isReflexive isIrreflexive isSymmetricisAntisymmetric isAsymmetric isEquivalenceisPartialOrderisStrictPartialOrder isTotalOrderisStrictTotalOrder isComparison isIdempotent isIdentityisNeverIdentityokEqokOrdokEqOrdokNumNonNegativeokNum=$$==||= commutative associative distributive symmetric2 transitive reflexive irreflexive symmetric antisymmetric asymmetric equivalence partialOrderstrictPartialOrder totalOrderstrictTotalOrder comparison idempotentidentity neverIdentityLetters unLetters AlphaNums unAlphaNumsDigitsunDigitsAlphasunAlphasUppersunUppersLowersunLowersSpacesunSpacesLetterunLetterAlphaNum unAlphaNumDigitunDigitAlphaunAlphaUpperunUpperLowerunLowerSpaceunSpaceXsXunXMapBagNoDupUInt4UInt3UInt2UInt1Nat7unNat7Nat6unNat6Nat5unNat5Nat4unNat4Nat3unNat3Nat2unNat2Nat1unNat1NatunNat unNaturalWord4unWord4Word3unWord3Word2unWord2Word1unWord1Int4unInt4Int3unInt3Int2unInt2Int1unInt1$fListableInt1$fIxInt1 $fEnumInt1 $fBoundedInt1$fIntegralInt1 $fRealInt1 $fNumInt1 $fReadInt1 $fShowInt1$fListableInt2$fIxInt2 $fEnumInt2 $fBoundedInt2$fIntegralInt2 $fRealInt2 $fNumInt2 $fReadInt2 $fShowInt2$fListableInt3$fIxInt3 $fEnumInt3 $fBoundedInt3$fIntegralInt3 $fRealInt3 $fNumInt3 $fReadInt3 $fShowInt3$fListableInt4$fIxInt4 $fEnumInt4 $fBoundedInt4$fIntegralInt4 $fRealInt4 $fNumInt4 $fReadInt4 $fShowInt4$fListableWord1 $fIxWord1 $fEnumWord1$fBoundedWord1$fIntegralWord1 $fRealWord1 $fNumWord1 $fReadWord1 $fShowWord1$fListableWord2 $fIxWord2 $fEnumWord2$fBoundedWord2$fIntegralWord2 $fRealWord2 $fNumWord2 $fReadWord2 $fShowWord2$fListableWord3 $fIxWord3 $fEnumWord3$fBoundedWord3$fIntegralWord3 $fRealWord3 $fNumWord3 $fReadWord3 $fShowWord3$fListableWord4 $fIxWord4 $fEnumWord4$fBoundedWord4$fIntegralWord4 $fRealWord4 $fNumWord4 $fReadWord4 $fShowWord4$fListableNatural $fIxNatural $fEnumNatural$fIntegralNatural $fRealNatural $fNumNatural $fReadNatural $fShowNatural $fListableNat$fIxNat $fEnumNat $fBoundedNat $fIntegralNat $fRealNat$fNumNat $fReadNat $fShowNat$fListableNat1$fIxNat1 $fEnumNat1 $fBoundedNat1$fIntegralNat1 $fRealNat1 $fNumNat1 $fReadNat1 $fShowNat1$fListableNat2$fIxNat2 $fEnumNat2 $fBoundedNat2$fIntegralNat2 $fRealNat2 $fNumNat2 $fReadNat2 $fShowNat2$fListableNat3$fIxNat3 $fEnumNat3 $fBoundedNat3$fIntegralNat3 $fRealNat3 $fNumNat3 $fReadNat3 $fShowNat3$fListableNat4$fIxNat4 $fEnumNat4 $fBoundedNat4$fIntegralNat4 $fRealNat4 $fNumNat4 $fReadNat4 $fShowNat4$fListableNat5$fIxNat5 $fEnumNat5 $fBoundedNat5$fIntegralNat5 $fRealNat5 $fNumNat5 $fReadNat5 $fShowNat5$fListableNat6$fIxNat6 $fEnumNat6 $fBoundedNat6$fIntegralNat6 $fRealNat6 $fNumNat6 $fReadNat6 $fShowNat6$fListableNat7$fIxNat7 $fEnumNat7 $fBoundedNat7$fIntegralNat7 $fRealNat7 $fNumNat7 $fReadNat7 $fShowNat7$fListableNoDup $fListableBag $fListableSet $fListableMap $fListableX$fShowX $fListableXs$fListableSpace $fShowSpace$fListableLower $fShowLower$fListableUpper $fShowUpper$fListableAlpha $fShowAlpha$fListableDigit $fShowDigit$fListableAlphaNum$fShowAlphaNum$fListableLetter $fShowLetter$fListableSpaces $fShowSpaces$fListableLowers $fShowLowers$fListableUppers $fShowUppers$fListableAlphas $fShowAlphas$fListableDigits $fShowDigits$fListableAlphaNums$fShowAlphaNums$fListableLetters $fShowLetters$fEqInt1 $fOrdInt1$fEqInt2 $fOrdInt2$fEqInt3 $fOrdInt3$fEqInt4 $fOrdInt4 $fEqWord1 $fOrdWord1 $fEqWord2 $fOrdWord2 $fEqWord3 $fOrdWord3 $fEqWord4 $fOrdWord4 $fEqNatural $fOrdNatural$fEqNat$fOrdNat$fEqNat1 $fOrdNat1$fEqNat2 $fOrdNat2$fEqNat3 $fOrdNat3$fEqNat4 $fOrdNat4$fEqNat5 $fOrdNat5$fEqNat6 $fOrdNat6$fEqNat7 $fOrdNat7 $fShowNoDup $fReadNoDup $fEqNoDup $fOrdNoDup $fShowBag $fReadBag$fEqBag$fOrdBag $fShowSet $fReadSet$fEqSet$fOrdSet $fShowMap $fReadMap$fEqMap$fOrdMap$fEqX$fOrdX$fEqXs$fOrdXs$fShowXs$fReadXs-:-:>->:->:>->>:->>:>->>>:->>>:>->>>>:->>>>:>->>>>>:->>>>>:>->>>>>>: ->>>>>>:> ->>>>>>>: ->>>>>>>:> ->>>>>>>>: ->>>>>>>>:> ->>>>>>>>>: ->>>>>>>>>:> ->>>>>>>>>>: ->>>>>>>>>>:> ->>>>>>>>>>>:->>>>>>>>>>>:>->>>>>>>>>>>>:>-undintintegerfloatdoublerationalboolcharstringorderingmaybeithnaturalnatint1int2int3int4word1word2word3word4uint1uint2uint3uint4 ShowFunction bindtiersBindingbindings bindtiersShow showFunctionshowFunctionLineclarifiedBindingsdescribedBindingsexplainedBindings$fShowFunctionCSUSeconds$fShowFunctionCUSeconds$fShowFunctionCBool$fShowFunctionCDouble$fShowFunctionCFloat$fShowFunctionCTime$fShowFunctionCClock$fShowFunctionCUIntMax$fShowFunctionCIntMax$fShowFunctionCUIntPtr$fShowFunctionCIntPtr$fShowFunctionCULLong$fShowFunctionCLLong$fShowFunctionCSigAtomic$fShowFunctionCWchar$fShowFunctionCSize$fShowFunctionCPtrdiff$fShowFunctionCULong$fShowFunctionCLong$fShowFunctionCUInt$fShowFunctionCInt$fShowFunctionCUShort$fShowFunctionCShort$fShowFunctionCUChar$fShowFunctionCSChar$fShowFunctionCChar$fShowFunctionGeneralCategory$fShowFunctionBufferMode$fShowFunctionIOMode$fShowFunctionSeekMode$fShowFunctionExitCode$fShowFunctionMap$fShowFunctionNoDup$fShowFunctionBag$fShowFunctionSet$fShowFunctionXs$fShowFunctionX$fShowFunctionLetters$fShowFunctionAlphaNums$fShowFunctionDigits$fShowFunctionAlphas$fShowFunctionUppers$fShowFunctionLowers$fShowFunctionSpaces$fShowFunctionSpace$fShowFunctionLower$fShowFunctionUpper$fShowFunctionAlpha$fShowFunctionDigit$fShowFunctionAlphaNum$fShowFunctionLetter$fShowFunctionNatural$fShowFunctionWord4$fShowFunctionWord3$fShowFunctionWord2$fShowFunctionWord1$fShowFunctionInt4$fShowFunctionInt3$fShowFunctionInt2$fShowFunctionInt1$fShowFunctionNat7$fShowFunctionNat6$fShowFunctionNat5$fShowFunctionNat4$fShowFunctionNat3$fShowFunctionNat2$fShowFunctionNat1$fShowFunctionNat$fShowFunctionWord64$fShowFunctionWord32$fShowFunctionWord16$fShowFunctionWord8$fShowFunctionInt64$fShowFunctionInt32$fShowFunctionInt16$fShowFunctionInt8$fShowFunctionComplex$fShowFunctionRatio$fShowFunction(,,,,,,,,,,,)$fShowFunction(,,,,,,,,,,)$fShowFunction(,,,,,,,,,)$fShowFunction(,,,,,,,,)$fShowFunction(,,,,,,,)$fShowFunction(,,,,,,)$fShowFunction(,,,,,)$fShowFunction(,,,,)$fShowFunction(,,,)$fShowFunction(,,)$fShowFunction->$fShowFunction(,)$fShowFunctionEither$fShowFunctionMaybe$fShowFunction[]$fShowFunctionOrdering$fShowFunctionDouble$fShowFunctionFloat$fShowFunctionChar$fShowFunctionInteger$fShowFunctionWord$fShowFunctionInt$fShowFunctionBool$fShowFunction()$fShow->base Data.FoldableconcatGHC.RealIntegralghc-prim GHC.TypesIntWord Fractional GHC.FloatFloatingGHC.BasemapGHC.Listfilter concatMapflip GHC.MaybeJustNothingDoubleFloattemplate-haskellLanguage.Haskell.TH.SyntaxName typeArity GHC.GenericsGenericTrue GHC.ClassesEqfit normalize maxLengthMaybeOrd choicesWithbagChoicesWithsetChoicesWith listLines showListLinesdotsLongerThanGHC.ShowshowprintincompleteSetsOfbindArgumentType GHC.IO.UnsafeunsafePerformIOFalse&&||compare==/=GHC.NumNumGHC.EnummaxBoundEnum integer-gmpGHC.Integer.TypeInteger++|asTypeOfRationalBoolCharStringOrdering Data.EitherEitherGHC.Err undefinedhead isUndefined isConstant showConstant<~<~~Show