factorial :: Int -> Int -- testing 4 combinations of argument values -- pruning with 4/8 rules -- looking through 2 candidates of size 1 -- looking through 1 candidates of size 2 -- looking through 1 candidates of size 3 -- looking through 1 candidates of size 4 -- looking through 1 candidates of size 5 -- looking through 9 candidates of size 6 factorial x = foldr (*) 1 [1..x] factorial :: Int -> Int -- testing 4 combinations of argument values -- pruning with 22/42 rules -- looking through 3 candidates of size 1 -- looking through 6 candidates of size 2 -- looking through 16 candidates of size 3 -- looking through 39 candidates of size 4 -- looking through 78 candidates of size 5 -- looking through 166 candidates of size 6 factorial 0 = 1 factorial x = x * factorial (dec x)