Niner since 2009
I have the same problem in ghci.What does work though is to type:
let f :: Int -> Int -> Int; f a b = a + b
So you need to type the type definition and the function definition in one statement.I think this is because you're using an interpreter instead of a compiler.
I'm a beginner myself so, my apologies if any of the terminology is incorrect.
Apparently there are multiple pages of comments and this question has already been answered, oops