I wrote what I think is the same function in the following three ways:
addThree x y z = x + y + z
addThree' = \x y z -> x + y + z
addThree'' = \x -> \y -> \z -> x + y + z
Yet when I load and check their types in GHCi using :t
, it gives me a very weird answer:
addThree :: Num a => a -> a -> a -> a
addThree' :: Integer -> Integer -> Integer -> Integer
addThree'' :: Integer -> Integer -> Integer -> Integer
Why do the lambdas have different, specialized types while the normal one has the correct type?