I could not find the difference
Yes, there are some differences.
:t exp'
exp' :: Int -> Int -> Int
:t (^)
(^) :: (Num a, Integral b) => a -> b -> a
namely
:t (^)
-- Num Integral Num
(^) :: (Num a, Integral b) => a -> b -> a
Cm? This is about type.
Simply put, it is Intlimited, so it can overflow to a negative value when the allowable range is exceeded:
> (6::Int) ^ (25::Int)
-8463200117489401856
But it is Integerunlimited, therefore it is not overflowed:
> (6::Integer) ^ (25::Integer)
+28430288029929701376
, , Int Integer:
exp' :: Integer -> Integer -> Integer
exp' = (^)
https://www.haskell.org/tutorial/numbers.html .