3 ms·
It is not a lambda but a switch expression. The tricky bits here are separating a call and the returned expression with ;. The trailing comma is just sugar to a
by bng5 3y ago
It is not a lambda but a switch expression. The tricky bits here are separating a call and the returned expression with ;. The trailing comma is just sugar to allow for another case
- jve 3y agoUnderstood. You want to escape curly braces and let the last expression be the returned one. F# does implicitly return the last expression. > The expression is the body of the function, the last expression of which generates a return value. Examples of valid lambda expressions include the following: https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/functions/lambda-expressions-the-fun-keyword#remarks https://learn.microsoft.com/en-us/dotnet/fsharp/language-ref...