Closed lucasteles closed 9 months ago
You can specify the type of the expression right now, if needed:
let handler =
fun (n: int) -> (if n % 2 = 0 then Ok() else Error(n)) : obj
Gonna tag this as probably not
-- while in theory it could be nice to have the return type definition closer to the parameters, this doesn't seem worth doing:
Closing down all probably not
issues, until there's another consideration about it.
Allowing specifying the explicit return type of lambdas is something that can't be done and could be useful in some cases and it is also something that should be supported to be paired with
let
functions.One case is dealing with implicit return types
Pros and Cons
The advantages of making this adjustment to F# are:
The disadvantages of making this adjustment to F# are ...
Extra information
Estimated cost (XS, S, M, L, XL, XXL): ?
Related suggestions: (put links to related suggestions here)
Affidavit (please submit!)
Please tick this by placing a cross in the box:
Please tick all that apply:
For Readers
If you would like to see this issue implemented, please click the :+1: emoji on this issue. These counts are used to generally order the suggestions by engagement.