Foldl

product_td :: Num a => [a] -> a
product_td = _product 1
         where
             _product v [] = v
             _product v (x:xs) = _product (v * x) xs

Note: The base case _product v [] = v returns v, which is the result of the recursed function calls.

or

product_td :: Num a => [a] -> a
product_td = foldl (*) 1

You'll only receive email when they publish something new.

More from T