Basically, every function in F# has one parameter and returns one value. That value can be of type unit, designated by (), which is similar in concept to void in some other languages.
When you have a function that appears to have more than one parameter, F# treats it as several functions, each with one parameter, that are then "curried" to come up with the result you want. So, in your example, you have:
let addTwoNumbers x y = x + y
That is really two different functions. One takes x
and creates a new function that will add the value of x
to the value of the new function's parameter. The new function takes the parameter y
and returns an integer result.
So, addTwoNumbers 5 6
would indeed return 11. But, addTwoNumbers 5
is also syntactically valid and would return a function that adds 5 to its parameter. That is why add5ToNumber 6
is valid.