@mrchance How would it?
@didibus Well, the return type of a function is obviously the type of the body, and if y is used as an arg to +, then it must be a number. Sounds pretty straightforward to me.
I am reasonably sure that Haskell could infer it
It can
test x = x + 5
*Main> :t test
test :: Num a => a -> a