No, this is not bad. The type is strange, and probably there can be no significant values ββfor which it makes sense, but it is still allowed.
Keep in mind that literals are overloaded. 1 not an integer. This is something like Num . Functions are not excluded from this. There is no rule saying that a -> t cannot be a "number" (that is, an Num instance).
For example, you might have an instance declaration, for example:
instance Num a => Num (a -> b) where fromInteger x = undefined [...]
now 1 1 will just be undefined . Not very useful, but still relevant.
You may have useful Num definitions for functions. For example, from the wiki
instance Num b => Num (a -> b) where negate = fmap negate (+) = liftA2 (+) (*) = liftA2 (*) fromInteger = pure . fromInteger abs = fmap abs signum = fmap signum
With this, you can write things like:
f + g
where f and g are functions that return numbers.
Using the above instance declaration 1 2 will be equal to 1 . Basically, the literal used as a function with the above instance is const <that-literal> .
source share