Define a function the same way as define lambda
Currently the way we define function is: let add1 x = x +1 which is not consistent with the way we define lambda fun x -> x +1. More importantly this will help new learner like me easily distinguish between a function and a value. When reading code, I always find it easier to find a lambda expression because of the fun keyword and the -> than the function. Since code is read more than write it would help save time too.
While we appreciate the feedback, this kind of fundamental syntax change is beyond the scope of the kind of change we would consider for the F# language at version F# 4.0.
Don Syme, F# Language Evolution
Vasily Kirichenko commented
Currently "fun add1 x -> x + 1" is a (curried) lambda function, so you cannot use this syntax for anything else.
Vanh Phom commented
What I mean is:
fun add1 x -> x + 1 define a function name add1 with parameter x and body x + 1
fun x -> x +1 define a no name function (lambda) with parameter x and body x + 1
Richard Gibson commented
Sorry, I guess I'm not sure what you're asking for.
let add1 x = x + 1
is just short for
let add1 = fun x -> x + 1
Both are legal F#. Is there something else you're after?