In the following code
product :: [Integer] -> Integer
product [] = 1
product i f = foldl (*) 1 [i..f]
you declare the type of product
is [Integer] -> Integer
, but in the second clause, you give it two parameters, this obviously does not match with its type.
You can define it simply like this
product xs = foldl (*) 1 xs
and use it like this
product [i..f]
By the way, product
is a standard function offered by Prelude
, with a similar (better) type and the same function.