I was learning anonymous functions in haskell.
mTH3 x = (\y -> \z -> x*y*z)
The type signature for this comes out to be
*Main> :t mTH3
mTH3 :: Num a => a -> a -> a -> a
Whereas for this function
mTH4 = (\x -> \y -> \z -> x*y*z)
It comes out to be
*Main> :t mTH4
mTH4 :: Integer -> Integer -> Integer -> Integer
What is the reason of difference between them. Why isn't the type signature for second function same as first. If I try to define type signature of the second function like this :
mTH4 :: Num a => a -> a -> a -> a
mTH4 = (\x -> \y -> \z -> x*y*z)
Then the output is same as the mTH3
function.