-- An online type checker for the Haskell programming language (see haskell.org).
inverte :: [a] -> [a]
inverte [] = []
inverte (x:xs) = inverte xs ++ [x]
fat1 :: Integer -> Integer
fat1 0 = 1
fat1 n = n*fat1(n-1)
fat2 :: Integer -> Integer
fat2 n = if n==0 then 1 else n*fat2(n-1)
fat3 n = product [1..n]
fat4 n = foldl (*) 1 [1..n]
fat5 = product . enumFromTo 1
main = putStrLn (show (fat1(12) ) ) >> putStrLn (show (fat2(5) ) )
>> putStrLn (show (fat3(8) ) ) >> putStrLn (show (fat4(10) ) )
>> putStrLn (show (fat5(7) ) )