-
Notifications
You must be signed in to change notification settings - Fork 783
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
[FS-1045] F# 4.x: Add ToFSharpFunc overloads for Func<...>, especially for .NET Core #3013
Conversation
@cartermp @neoeinstein Just to note this will need an RFC since this also adds more overloads for ToFSharpFunc on .NET Framework Also adds this on the Converter overload
|
Surface area change ... FSharp 4.2? |
Hmmm... Yes in principle. But we should get the missing functionality into our FSharp.Core for .NET Core sooner than that I think. I'll look if we can add just the one overload somehow |
@dsyme I'm okay with reving the version number, there are a number of PR's we would take if we do this. |
@dsyme can you resolve the conflicts pls. |
@KevinRansom resolved |
@cartermp @KevinRansom I've written the RFC https://github.com/fsharp/fslang-design/blob/master/RFCs/FS-1045-func-to-fsharpfunc-overloads.md However as noted in the RFC this is a breaking change for some C# code, so don't merge this until we resolve that design question |
See comment here and in the RFC - I think we should not go ahead with this because it is a breaking change, and instead we should provide a .NET Standard 2.0 build of FSHarp.Core.dll where System.Converter is available. Then we can keep the FuncConvert API the same as it has always been. |
Everything except In that case, why not just skip it? IF the user proves an inline lambda, then the C# compiler will happily map it to a Converter instead of a Func. IF the user wants to pass-through an existing Func delegate, then he would need to wrap it once - but I don't think that would be a killer-downside, and it wouldn't be worse than the current state. |
@dsyme ... what do you want to do with this PR? |
@dsyme, can you retarget this to |
@brettfo Are you sure you don't want this at |
Continued at #4815 |
RFC https://github.com/fsharp/fslang-design/blob/master/RFCs/FS-1045-func-to-fsharpfunc-overloads.md
Addresses #1847 - ToFSharpFunc(Func) missing in .NET Core.
Adds
There was no good way to create an FSharpFunc object from C# on .NET core with a method call.