-
Notifications
You must be signed in to change notification settings - Fork 790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FSharpFunc => Action/Func implicit conversion #2907
Comments
This adds some corner cases and implicit typing to the language. Maybe another way would be to have an operator for this, which converts to |
@matthid the compiler already converts lambdas to |
@vasily-kirichenko But from a users perspective that's not an implicit conversion, instead the user is writing an action or func in that case (I guess that's a philosophical question). Maybe @dsyme can share his opinion on this. |
@matthid I had the same idea re: improve error reporting with guidance on how to convert (perhaps not even operators, just a few utility funcs added to FSharp.Core?) |
@vasily-kirichenko consider adding some elements to #2503 |
IMHO this is a problem with delegates altogether, not only |
Thanks @smoothdeveloper after fsharp/fslang-suggestions#248 (comment) I kind of changed my mind. Maybe we need it to just work :) |
@matthid @vasily-kirichenko @smoothdeveloper Yes, this is a glitch (my fault, sorry...) that should be fixed. I've marked fsharp/fslang-suggestions#248 as approved in principle Next steps would be to dig into the "single overload" path of method overload resolution and understand why it differs from the "multiple overload" path. (F# applies specific rules to single overload method groups to process curried members - which can't be overloaded - among other things) |
Closing as this is an approved RFC, we just need to implement this |
It's super annoying that F# functions are not converted automatically to
Action
/Func
when passed to methods:So we have to write ugly code like this
Action<_> (printfn "%s")
or like thisfun x -> printfn "%s" x
The text was updated successfully, but these errors were encountered: