packages feed

code-conjure-0.5.4: eg/replicate.out

replicate :: Int -> Char -> [Char]
-- testing 360 combinations of argument values
-- pruning with 4/7 rules
-- looking through 1 candidates of size 1
-- looking through 0 candidates of size 2
-- looking through 1 candidates of size 3
-- looking through 1 candidates of size 4
-- looking through 3 candidates of size 5
-- looking through 5 candidates of size 6
-- looking through 5 candidates of size 7
-- looking through 8 candidates of size 8
-- tested 17 candidates
replicate 0 c  =  ""
replicate x c  =  c:replicate (x - 1) c

replicates :: [Char] -> Int -> [Char]
-- testing 360 combinations of argument values
-- pruning with 2/2 rules
-- looking through 1 candidates of size 1
-- looking through 0 candidates of size 2
-- looking through 0 candidates of size 3
-- looking through 1 candidates of size 4
-- looking through 1 candidates of size 5
-- tested 3 candidates
replicates cs x  =  concat (transpose (replicate x cs))

replicates :: [Char] -> Int -> [Char]
-- testing 360 combinations of argument values
-- pruning with 0/0 rules
-- looking through 1 candidates of size 1
-- looking through 0 candidates of size 2
-- looking through 0 candidates of size 3
-- looking through 0 candidates of size 4
-- looking through 1 candidates of size 5
-- tested 2 candidates
replicates cs x  =  concat (map (replicate x) cs)

replicates :: [Char] -> Int -> [Char]
-- testing 360 combinations of argument values
-- pruning with 9/14 rules
-- looking through 2 candidates of size 1
-- looking through 3 candidates of size 2
-- looking through 7 candidates of size 3
-- looking through 24 candidates of size 4
-- looking through 64 candidates of size 5
-- looking through 161 candidates of size 6
-- looking through 469 candidates of size 7
-- looking through 1303 candidates of size 8
-- tested 791 candidates
replicates "" x  =  ""
replicates (c:cs) x  =  replicate x c ++ replicates cs x