factorial :: Int -> Int
-- testing 6 combinations of argument values
-- looking through 2 candidates of size 1
-- looking through 0 candidates of size 2
-- looking through 0 candidates of size 3
-- looking through 2 candidates of size 4
factorial n = product (enumFromTo 1 n)
factorial :: Int -> Int
-- testing 6 combinations of argument values
-- looking through 3 candidates of size 1
-- looking through 2 candidates of size 2
-- looking through 5 candidates of size 3
-- looking through 6 candidates of size 4
-- looking through 20 candidates of size 5
-- looking through 27 candidates of size 6
-- looking through 87 candidates of size 7
-- looking through 167 candidates of size 8
-- looking through 417 candidates of size 9
-- looking through 960 candidates of size 10
factorial n = if n == 0 then 1 else n * factorial (dec n)