Consider:
λ :type (+) @Integer
(+) @Integer :: Integer -> Integer -> Integer
λ :type (\x y -> x + y) @Integer
...
...error...
...Cannot apply expression...
...
λ f = (+)
λ :type f @Integer
...
...error...
...Cannot apply expression...
...
λ g = \x y -> x + y
λ :type g @Integer
...
...error...
...Cannot apply expression...
...
λ h x y = x + y
λ :type h @Integer
...
...error...
...Cannot apply expression...
...
At the same time:
λ :type (+)
... :: Num a => a -> a -> a
λ :type (\x y -> x + y)
... :: Num a => a -> a -> a
λ :type f
... :: Num a => a -> a -> a
λ :type g
... :: Num a => a -> a -> a
λ :type h
... :: Num a => a -> a -> a
So, even though there is no distinction in the type of these objects, they appear as distinct to the type application.
- Why?
- Am I missing something obvious?
- Is this a bug?
- Is this a feature?
- Is this poor language design?
- Is this great language design?