power :: (Num a, Integral b) => a -> b -> a
power base n
  | n == 0    = 1
  | even n    = square (power base (div n 2))
  | otherwise = base * square (power base (div n 2))
  where square x = x*x


--Task 5
power base n
  | n == 0    = 1
  | even n    = square (power base (div n 2))
  | otherwise = base * square (power base (div n 2))
  where square x = x*x


--Task 5