module Test.LeanCheck.Tiers
(
listCons
, setCons
, bagCons
, mapCons
, noDupListCons
, maybeCons0
, maybeCons1
, maybeCons2
, product3
, product3With
, productMaybeWith
, listsOf
, bagsOf
, setsOf
, noDupListsOf
, products
, maps
, listsOfLength
, distinctPairs
, distinctPairsWith
, unorderedPairs
, unorderedPairsWith
, unorderedDistinctPairs
, unorderedDistinctPairsWith
, deleteT
, normalizeT
, catMaybesT
, mapMaybeT
, discardT
, discardLaterT
, nubT
, choices
, setChoices
, bagChoices
, printTiers
, showTiers
, finite
)
where
import Test.LeanCheck.Basic
import Data.Maybe (catMaybes)
listCons :: Listable a => ([a] -> b) -> [[b]]
listCons :: forall a b. Listable a => ([a] -> b) -> [[b]]
listCons = (forall a b. (a -> b) -> [[a]] -> [[b]]
`mapT` forall a. [[a]] -> [[[a]]]
listsOf forall a. Listable a => [[a]]
tiers)
bagCons :: Listable a => ([a] -> b) -> [[b]]
bagCons :: forall a b. Listable a => ([a] -> b) -> [[b]]
bagCons = (forall a b. (a -> b) -> [[a]] -> [[b]]
`mapT` forall a. [[a]] -> [[[a]]]
bagsOf forall a. Listable a => [[a]]
tiers)
setCons :: Listable a => ([a] -> b) -> [[b]]
setCons :: forall a b. Listable a => ([a] -> b) -> [[b]]
setCons = (forall a b. (a -> b) -> [[a]] -> [[b]]
`mapT` forall a. [[a]] -> [[[a]]]
setsOf forall a. Listable a => [[a]]
tiers)
mapCons :: (Listable a, Listable b) => ([(a,b)] -> c) -> [[c]]
mapCons :: forall a b c. (Listable a, Listable b) => ([(a, b)] -> c) -> [[c]]
mapCons = (forall a b. (a -> b) -> [[a]] -> [[b]]
`mapT` forall a b. [[a]] -> [[b]] -> [[[(a, b)]]]
maps forall a. Listable a => [[a]]
tiers forall a. Listable a => [[a]]
tiers)
noDupListCons :: Listable a => ([a] -> b) -> [[b]]
noDupListCons :: forall a b. Listable a => ([a] -> b) -> [[b]]
noDupListCons = (forall a b. (a -> b) -> [[a]] -> [[b]]
`mapT` forall a. [[a]] -> [[[a]]]
noDupListsOf forall a. Listable a => [[a]]
tiers)
maybeCons0 :: Maybe b -> [[b]]
maybeCons0 :: forall b. Maybe b -> [[b]]
maybeCons0 Maybe b
Nothing = []
maybeCons0 (Just b
x) = [[b
x]]
maybeCons1 :: Listable a => (a -> Maybe b) -> [[b]]
maybeCons1 :: forall a b. Listable a => (a -> Maybe b) -> [[b]]
maybeCons1 a -> Maybe b
f = forall a. [[a]] -> [[a]]
delay forall a b. (a -> b) -> a -> b
$ forall a b. (a -> Maybe b) -> [[a]] -> [[b]]
mapMaybeT a -> Maybe b
f forall a. Listable a => [[a]]
tiers
maybeCons2 :: (Listable a, Listable b) => (a -> b -> Maybe c) -> [[c]]
maybeCons2 :: forall a b c.
(Listable a, Listable b) =>
(a -> b -> Maybe c) -> [[c]]
maybeCons2 a -> b -> Maybe c
f = forall a. [[a]] -> [[a]]
delay forall a b. (a -> b) -> a -> b
$ forall a b. (a -> Maybe b) -> [[a]] -> [[b]]
mapMaybeT (forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry a -> b -> Maybe c
f) forall a. Listable a => [[a]]
tiers
product3 :: [[a]] -> [[b]]-> [[c]] -> [[(a,b,c)]]
product3 :: forall a b c. [[a]] -> [[b]] -> [[c]] -> [[(a, b, c)]]
product3 = forall a b c d.
(a -> b -> c -> d) -> [[a]] -> [[b]] -> [[c]] -> [[d]]
product3With (\a
x b
y c
z -> (a
x,b
y,c
z))
product3With :: (a->b->c->d) -> [[a]] -> [[b]] -> [[c]] -> [[d]]
product3With :: forall a b c d.
(a -> b -> c -> d) -> [[a]] -> [[b]] -> [[c]] -> [[d]]
product3With a -> b -> c -> d
f [[a]]
xss [[b]]
yss [[c]]
zss = forall a b c. (a -> b -> c) -> [[a]] -> [[b]] -> [[c]]
productWith forall a b. (a -> b) -> a -> b
($) (forall a b c. (a -> b -> c) -> [[a]] -> [[b]] -> [[c]]
productWith a -> b -> c -> d
f [[a]]
xss [[b]]
yss) [[c]]
zss
productMaybeWith :: (a->b->Maybe c) -> [[a]] -> [[b]] -> [[c]]
productMaybeWith :: forall a b c. (a -> b -> Maybe c) -> [[a]] -> [[b]] -> [[c]]
productMaybeWith a -> b -> Maybe c
_ [[a]]
_ [] = []
productMaybeWith a -> b -> Maybe c
_ [] [[b]]
_ = []
productMaybeWith a -> b -> Maybe c
f ([a]
xs:[[a]]
xss) [[b]]
yss = forall a b. (a -> b) -> [a] -> [b]
map ([a]
xs [a] -> [b] -> [c]
**) [[b]]
yss
forall a. [[a]] -> [[a]] -> [[a]]
\/ forall a. [[a]] -> [[a]]
delay (forall a b c. (a -> b -> Maybe c) -> [[a]] -> [[b]] -> [[c]]
productMaybeWith a -> b -> Maybe c
f [[a]]
xss [[b]]
yss)
where
[a]
xs ** :: [a] -> [b] -> [c]
** [b]
ys = forall a. [Maybe a] -> [a]
catMaybes [ a -> b -> Maybe c
f a
x b
y | a
x <- [a]
xs, b
y <- [b]
ys ]
distinctPairs :: [[a]] -> [[(a,a)]]
distinctPairs :: forall a. [[a]] -> [[(a, a)]]
distinctPairs = forall a b. (a -> a -> b) -> [[a]] -> [[b]]
distinctPairsWith (,)
distinctPairsWith :: (a -> a -> b) -> [[a]] -> [[b]]
distinctPairsWith :: forall a b. (a -> a -> b) -> [[a]] -> [[b]]
distinctPairsWith a -> a -> b
f = forall a. [[[[a]]]] -> [[a]]
concatT forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> [[a]] -> b) -> [[a]] -> [[b]]
choicesWith (\a
e -> forall a b. (a -> b) -> [[a]] -> [[b]]
mapT (a -> a -> b
f a
e))
unorderedPairs :: [[a]] -> [[(a,a)]]
unorderedPairs :: forall a. [[a]] -> [[(a, a)]]
unorderedPairs = forall a b. (a -> a -> b) -> [[a]] -> [[b]]
unorderedPairsWith (,)
unorderedPairsWith :: (a -> a -> b) -> [[a]] -> [[b]]
unorderedPairsWith :: forall a b. (a -> a -> b) -> [[a]] -> [[b]]
unorderedPairsWith a -> a -> b
f = forall a. [[[[a]]]] -> [[a]]
concatT forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> [[a]] -> b) -> [[a]] -> [[b]]
bagChoicesWith (\a
e -> forall a b. (a -> b) -> [[a]] -> [[b]]
mapT (a -> a -> b
f a
e))
unorderedDistinctPairs :: [[a]] -> [[(a,a)]]
unorderedDistinctPairs :: forall a. [[a]] -> [[(a, a)]]
unorderedDistinctPairs = forall a b. (a -> a -> b) -> [[a]] -> [[b]]
unorderedDistinctPairsWith (,)
unorderedDistinctPairsWith :: (a -> a -> b) -> [[a]] -> [[b]]
unorderedDistinctPairsWith :: forall a b. (a -> a -> b) -> [[a]] -> [[b]]
unorderedDistinctPairsWith a -> a -> b
f = forall a. [[[[a]]]] -> [[a]]
concatT forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> [[a]] -> b) -> [[a]] -> [[b]]
setChoicesWith (\a
e -> forall a b. (a -> b) -> [[a]] -> [[b]]
mapT (a -> a -> b
f a
e))
listsOf :: [[a]] -> [[[a]]]
listsOf :: forall a. [[a]] -> [[[a]]]
listsOf [[a]]
xss = forall a. a -> [[a]]
cons0 []
forall a. [[a]] -> [[a]] -> [[a]]
\/ forall a. [[a]] -> [[a]]
delay (forall a b c. (a -> b -> c) -> [[a]] -> [[b]] -> [[c]]
productWith (:) [[a]]
xss (forall a. [[a]] -> [[[a]]]
listsOf [[a]]
xss))
products :: [ [[a]] ] -> [[ [a] ]]
products :: forall a. [[[a]]] -> [[[a]]]
products = forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr (forall a b c. (a -> b -> c) -> [[a]] -> [[b]] -> [[c]]
productWith (:)) [[[]]]
deleteT :: Eq a => a -> [[a]] -> [[a]]
deleteT :: forall a. Eq a => a -> [[a]] -> [[a]]
deleteT a
_ [] = []
deleteT a
y ([]:[[a]]
xss) = [] forall a. a -> [a] -> [a]
: forall a. Eq a => a -> [[a]] -> [[a]]
deleteT a
y [[a]]
xss
deleteT a
y [[a
x]] | a
x forall a. Eq a => a -> a -> Bool
== a
y = []
deleteT a
y ((a
x:[a]
xs):[[a]]
xss) | a
x forall a. Eq a => a -> a -> Bool
== a
y = [a]
xsforall a. a -> [a] -> [a]
:[[a]]
xss
| Bool
otherwise = [[a
x]] forall a. [[a]] -> [[a]] -> [[a]]
\/ forall a. Eq a => a -> [[a]] -> [[a]]
deleteT a
y ([a]
xsforall a. a -> [a] -> [a]
:[[a]]
xss)
normalizeT :: [[a]] -> [[a]]
normalizeT :: forall a. [[a]] -> [[a]]
normalizeT [] = []
normalizeT [[]] = []
normalizeT [[],[]] = []
normalizeT [[],[],[]] = []
normalizeT [[],[],[],[]] = []
normalizeT [[],[],[],[], []] = []
normalizeT [[],[],[],[], [],[]] = []
normalizeT [[],[],[],[], [],[],[]] = []
normalizeT [[],[],[],[], [],[],[],[]] = []
normalizeT [[],[],[],[], [],[],[],[], []] = []
normalizeT [[],[],[],[], [],[],[],[], [],[]] = []
normalizeT [[],[],[],[], [],[],[],[], [],[],[]] = []
normalizeT [[],[],[],[], [],[],[],[], [],[],[],[]] = []
normalizeT ([a]
xs:[[a]]
xss) = [a]
xsforall a. a -> [a] -> [a]
:forall a. [[a]] -> [[a]]
normalizeT [[a]]
xss
catMaybesT :: [[Maybe a]] -> [[a]]
catMaybesT :: forall a. [[Maybe a]] -> [[a]]
catMaybesT = forall a b. (a -> b) -> [a] -> [b]
map forall a. [Maybe a] -> [a]
catMaybes
mapMaybeT :: (a -> Maybe b) -> [[a]] -> [[b]]
mapMaybeT :: forall a b. (a -> Maybe b) -> [[a]] -> [[b]]
mapMaybeT a -> Maybe b
f = forall a. [[Maybe a]] -> [[a]]
catMaybesT forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [[a]] -> [[b]]
mapT a -> Maybe b
f
discardT :: (a -> Bool) -> [[a]] -> [[a]]
discardT :: forall a. (a -> Bool) -> [[a]] -> [[a]]
discardT a -> Bool
p = forall a. (a -> Bool) -> [[a]] -> [[a]]
filterT (Bool -> Bool
not forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Bool
p)
discardLaterT :: (a -> a -> Bool) -> [[a]] -> [[a]]
discardLaterT :: forall a. (a -> a -> Bool) -> [[a]] -> [[a]]
discardLaterT a -> a -> Bool
d [] = []
discardLaterT a -> a -> Bool
d ([]:[[a]]
xss) = [] forall a. a -> [a] -> [a]
: forall a. (a -> a -> Bool) -> [[a]] -> [[a]]
discardLaterT a -> a -> Bool
d [[a]]
xss
discardLaterT a -> a -> Bool
d ((a
x:[a]
xs):[[a]]
xss) = [[a
x]]
forall a. [[a]] -> [[a]] -> [[a]]
\/ forall a. (a -> a -> Bool) -> [[a]] -> [[a]]
discardLaterT a -> a -> Bool
d (forall a. (a -> Bool) -> [[a]] -> [[a]]
discardT (a -> a -> Bool
`d` a
x) ([a]
xsforall a. a -> [a] -> [a]
:[[a]]
xss))
nubT :: Ord a => [[a]] -> [[a]]
nubT :: forall a. Ord a => [[a]] -> [[a]]
nubT = forall a. (a -> a -> Bool) -> [[a]] -> [[a]]
discardLaterT forall a. Eq a => a -> a -> Bool
(==)
noDupListsOf :: [[a]] -> [[[a]]]
noDupListsOf :: forall a. [[a]] -> [[[a]]]
noDupListsOf =
([[]]forall a. a -> [a] -> [a]
:) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. [[[[a]]]] -> [[a]]
concatT forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> [[a]] -> b) -> [[a]] -> [[b]]
choicesWith (\a
x [[a]]
xss -> forall a b. (a -> b) -> [[a]] -> [[b]]
mapT (a
xforall a. a -> [a] -> [a]
:) (forall a. [[a]] -> [[[a]]]
noDupListsOf [[a]]
xss))
bagsOf :: [[a]] -> [[[a]]]
bagsOf :: forall a. [[a]] -> [[[a]]]
bagsOf = ([[]]forall a. a -> [a] -> [a]
:) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. [[[[a]]]] -> [[a]]
concatT forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> [[a]] -> b) -> [[a]] -> [[b]]
bagChoicesWith (\a
x [[a]]
xss -> forall a b. (a -> b) -> [[a]] -> [[b]]
mapT (a
xforall a. a -> [a] -> [a]
:) (forall a. [[a]] -> [[[a]]]
bagsOf [[a]]
xss))
setsOf :: [[a]] -> [[[a]]]
setsOf :: forall a. [[a]] -> [[[a]]]
setsOf = ([[]]forall a. a -> [a] -> [a]
:) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. [[[[a]]]] -> [[a]]
concatT forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> [[a]] -> b) -> [[a]] -> [[b]]
setChoicesWith (\a
x [[a]]
xss -> forall a b. (a -> b) -> [[a]] -> [[b]]
mapT (a
xforall a. a -> [a] -> [a]
:) (forall a. [[a]] -> [[[a]]]
setsOf [[a]]
xss))
maps :: [[a]] -> [[b]] -> [[[(a,b)]]]
maps :: forall a b. [[a]] -> [[b]] -> [[[(a, b)]]]
maps [[a]]
xss [[b]]
yss = forall a b. (a -> [[b]]) -> [[a]] -> [[b]]
concatMapT forall {a}. [a] -> [[[(a, b)]]]
mapsFor (forall a. [[a]] -> [[[a]]]
setsOf [[a]]
xss)
where
mapsFor :: [a] -> [[[(a, b)]]]
mapsFor [a]
xs = forall a b. [a] -> [b] -> [(a, b)]
zip [a]
xs forall a b. (a -> b) -> [[a]] -> [[b]]
`mapT` forall a. [[[a]]] -> [[[a]]]
products (forall a b. a -> b -> a
const [[b]]
yss forall a b. (a -> b) -> [a] -> [b]
`map` [a]
xs)
choices :: [[a]] -> [[(a,[[a]])]]
choices :: forall a. [[a]] -> [[(a, [[a]])]]
choices = forall a b. (a -> [[a]] -> b) -> [[a]] -> [[b]]
choicesWith (,)
choicesWith :: (a -> [[a]] -> b) -> [[a]] -> [[b]]
choicesWith :: forall a b. (a -> [[a]] -> b) -> [[a]] -> [[b]]
choicesWith a -> [[a]] -> b
f [] = []
choicesWith a -> [[a]] -> b
f [[]] = []
choicesWith a -> [[a]] -> b
f ([]:[[a]]
xss)
= [] forall a. a -> [a] -> [a]
: forall a b. (a -> [[a]] -> b) -> [[a]] -> [[b]]
choicesWith (\a
y [[a]]
yss -> a -> [[a]] -> b
f a
y ([]forall a. a -> [a] -> [a]
:forall a. [[a]] -> [[a]]
normalizeT [[a]]
yss)) [[a]]
xss
choicesWith a -> [[a]] -> b
f ((a
x:[a]
xs):[[a]]
xss)
= [[a -> [[a]] -> b
f a
x ([a]
xsforall a. a -> [a] -> [a]
:[[a]]
xss)]]
forall a. [[a]] -> [[a]] -> [[a]]
\/ forall a b. (a -> [[a]] -> b) -> [[a]] -> [[b]]
choicesWith (\a
y ([a]
ys:[[a]]
yss) -> a -> [[a]] -> b
f a
y ((a
xforall a. a -> [a] -> [a]
:[a]
ys)forall a. a -> [a] -> [a]
:[[a]]
yss)) ([a]
xsforall a. a -> [a] -> [a]
:[[a]]
xss)
bagChoices :: [[a]] -> [[(a,[[a]])]]
bagChoices :: forall a. [[a]] -> [[(a, [[a]])]]
bagChoices = forall a b. (a -> [[a]] -> b) -> [[a]] -> [[b]]
bagChoicesWith (,)
bagChoicesWith :: (a -> [[a]] -> b) -> [[a]] -> [[b]]
bagChoicesWith :: forall a b. (a -> [[a]] -> b) -> [[a]] -> [[b]]
bagChoicesWith a -> [[a]] -> b
f [] = []
bagChoicesWith a -> [[a]] -> b
f [[]] = []
bagChoicesWith a -> [[a]] -> b
f ([]:[[a]]
xss)
= []
forall a. a -> [a] -> [a]
: forall a b. (a -> [[a]] -> b) -> [[a]] -> [[b]]
bagChoicesWith (\a
y [[a]]
yss -> a -> [[a]] -> b
f a
y ([]forall a. a -> [a] -> [a]
:[[a]]
yss)) [[a]]
xss
bagChoicesWith a -> [[a]] -> b
f ((a
x:[a]
xs):[[a]]
xss)
= [[a -> [[a]] -> b
f a
x ((a
xforall a. a -> [a] -> [a]
:[a]
xs)forall a. a -> [a] -> [a]
:[[a]]
xss)]]
forall a. [[a]] -> [[a]] -> [[a]]
\/ forall a b. (a -> [[a]] -> b) -> [[a]] -> [[b]]
bagChoicesWith a -> [[a]] -> b
f ([a]
xsforall a. a -> [a] -> [a]
:[[a]]
xss)
setChoices :: [[a]] -> [[(a,[[a]])]]
setChoices :: forall a. [[a]] -> [[(a, [[a]])]]
setChoices = forall a b. (a -> [[a]] -> b) -> [[a]] -> [[b]]
setChoicesWith (,)
setChoicesWith :: (a -> [[a]] -> b) -> [[a]] -> [[b]]
setChoicesWith :: forall a b. (a -> [[a]] -> b) -> [[a]] -> [[b]]
setChoicesWith a -> [[a]] -> b
f [] = []
setChoicesWith a -> [[a]] -> b
f [[]] = []
setChoicesWith a -> [[a]] -> b
f ([]:[[a]]
xss)
= []
forall a. a -> [a] -> [a]
: forall a b. (a -> [[a]] -> b) -> [[a]] -> [[b]]
setChoicesWith (\a
y [[a]]
yss -> a -> [[a]] -> b
f a
y ([]forall a. a -> [a] -> [a]
:forall a. [[a]] -> [[a]]
normalizeT [[a]]
yss)) [[a]]
xss
setChoicesWith a -> [[a]] -> b
f ((a
x:[a]
xs):[[a]]
xss)
= [[a -> [[a]] -> b
f a
x ([a]
xsforall a. a -> [a] -> [a]
:[[a]]
xss)]]
forall a. [[a]] -> [[a]] -> [[a]]
\/ forall a b. (a -> [[a]] -> b) -> [[a]] -> [[b]]
setChoicesWith a -> [[a]] -> b
f ([a]
xsforall a. a -> [a] -> [a]
:[[a]]
xss)
listsOfLength :: Int -> [[a]] -> [[[a]]]
listsOfLength :: forall a. Int -> [[a]] -> [[[a]]]
listsOfLength Int
n [[a]]
xss = forall a. [[[a]]] -> [[[a]]]
products (forall a. Int -> a -> [a]
replicate Int
n [[a]]
xss)
listLines :: [String] -> String
listLines :: [String] -> String
listLines [] = String
"[]"
listLines [String
s] | Char
'\n' forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`notElem` String
s = String
"[" forall a. [a] -> [a] -> [a]
++ String
s forall a. [a] -> [a] -> [a]
++ String
"]"
listLines [String]
ss = (forall a. [a] -> [a] -> [a]
++ String
"]")
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [String] -> String
unlines
forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith String -> String -> String
beside ([String
"[ "] forall a. [a] -> [a] -> [a]
++ forall a. a -> [a]
repeat String
", ")
forall a b. (a -> b) -> a -> b
$ [String]
ss
where
beside :: String -> String -> String
beside :: String -> String -> String
beside String
s = forall a. [a] -> [a]
init
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [String] -> String
unlines
forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b c. (a -> b -> c) -> [a] -> [b] -> [c]
zipWith forall a. [a] -> [a] -> [a]
(++) ([String
s] forall a. [a] -> [a] -> [a]
++ forall a. a -> [a]
repeat (forall a. Int -> a -> [a]
replicate (forall (t :: * -> *) a. Foldable t => t a -> Int
length String
s) Char
' '))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> [String]
lines
showListLines :: Show a => [a] -> String
showListLines :: forall a. Show a => [a] -> String
showListLines = [String] -> String
listLines forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall a. Show a => a -> String
show
dotsLongerThan :: Int -> [String] -> [String]
dotsLongerThan :: Int -> [String] -> [String]
dotsLongerThan Int
n [String]
xs = forall a. Int -> [a] -> [a]
take Int
n [String]
xs forall a. [a] -> [a] -> [a]
++ [String
"..." | Bool -> Bool
not forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (t :: * -> *) a. Foldable t => t a -> Bool
null forall a b. (a -> b) -> a -> b
$ forall a. Int -> [a] -> [a]
drop Int
n [String]
xs]
showTiers :: Show a => Int -> [[a]] -> String
showTiers :: forall a. Show a => Int -> [[a]] -> String
showTiers Int
n = [String] -> String
listLines forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> [String] -> [String]
dotsLongerThan Int
n forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall a. Show a => [a] -> String
showListLines
printTiers :: Show a => Int -> [[a]] -> IO ()
printTiers :: forall a. Show a => Int -> [[a]] -> IO ()
printTiers Int
n = String -> IO ()
putStrLn forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Show a => Int -> [[a]] -> String
showTiers Int
n
finite :: [[a]] -> Bool
finite :: forall a. [[a]] -> Bool
finite = forall (t :: * -> *) a. Foldable t => t a -> Bool
null forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Int -> [a] -> [a]
drop Int
12 forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Int -> [a] -> [a]
take Int
60