[quickcheck: generate more and larger tuples
Helmut Grohne <grohne@cs.uni-bonn.de>**20150309130724
 Ignore-this: 1885b465841b9be0ea7e5717abc1b04d
] hunk ./src/Tests.hs 29
-instance QC.Arbitrary Kind where
- -- only generate kinds k such that simpleTypes (Star `Arrow` k) != []
- arbitrary = QC.elements [Star, Star `Arrow` Star]
+arrows 0 = Star
+arrows n = Star `Arrow` arrows (n - 1)
+
+simpleTypeKinds = [
+    (boolCon, arrows 0),
+    (intCon, arrows 0),
+    (tupleCon 0, arrows 0),
+    (listCon, arrows 1), 
+    (maybeCon, arrows 1),
+    (arrowCon, arrows 2),
+    (eitherCon, arrows 2)] ++ [ (tupleCon i, arrows i) | i <- [2..15] ]
hunk ./src/Tests.hs 42
-simpleTypes Star = [boolCon, intCon, tupleCon 0]
-simpleTypes (Star `Arrow` Star) = [listCon, maybeCon]
-simpleTypes (Star `Arrow` Star `Arrow` Star) = [arrowCon, eitherCon, tupleCon 2]
-simpleTypes _ = []
+simpleTypes kind = map fst $ filter ((kind ==) . snd) simpleTypeKinds
+
+instance QC.Arbitrary Kind where
+ arbitrary = QC.elements (takeWhile (not . null . simpleTypes) $ map arrows [0..])