packages feed

code-conjure-0.3.6: eg/ints.out

second :: [Int] -> Int
-- testing 60 combinations of argument values
-- looking through 2 candidates of size 1
-- looking through 1 candidates of size 2
-- looking through 2 candidates of size 3
second xs  =  head (tail xs)

third :: [Int] -> Int
-- testing 60 combinations of argument values
-- looking through 2 candidates of size 1
-- looking through 1 candidates of size 2
-- looking through 2 candidates of size 3
-- looking through 2 candidates of size 4
third xs  =  head (tail (tail xs))

sum :: [Int] -> Int
-- testing 60 combinations of argument values
-- looking through 2 candidates of size 1
-- looking through 1 candidates of size 2
-- looking through 2 candidates of size 3
-- looking through 2 candidates of size 4
-- looking through 5 candidates of size 5
-- looking through 5 candidates of size 6
-- looking through 15 candidates of size 7
-- looking through 27 candidates of size 8
-- looking through 57 candidates of size 9
-- looking through 119 candidates of size 10
sum xs  =  if null xs then 0 else head xs + sum (tail xs)

product :: [Int] -> Int
-- testing 60 combinations of argument values
-- looking through 2 candidates of size 1
-- looking through 1 candidates of size 2
-- looking through 2 candidates of size 3
-- looking through 2 candidates of size 4
-- looking through 5 candidates of size 5
-- looking through 5 candidates of size 6
-- looking through 15 candidates of size 7
-- looking through 27 candidates of size 8
-- looking through 57 candidates of size 9
-- looking through 119 candidates of size 10
product xs  =  if null xs then 1 else head xs * product (tail xs)

sum :: [Int] -> Int
-- testing 60 combinations of argument values
-- looking through 2 candidates of size 1
-- looking through 1 candidates of size 2
-- looking through 2 candidates of size 3
-- looking through 5 candidates of size 4
sum xs  =  foldr (+) 0 xs

product :: [Int] -> Int
-- testing 60 combinations of argument values
-- looking through 2 candidates of size 1
-- looking through 1 candidates of size 2
-- looking through 2 candidates of size 3
-- looking through 5 candidates of size 4
product xs  =  foldr (*) 1 xs