-
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
ToFSharpFunc(Func) missing in .NET Core #1847
Comments
@ruxo Right now the overload set is different on FSharp.Core, the "Converter" overload is not available. #if !FX_NO_CONVERTER
/// <summary>Convert the given Converter delegate object to an F# function value</summary>
/// <param name="converter">The input Converter.</param>
/// <returns>The F# function.</returns>
static member ToFSharpFunc : converter:Converter<'T,'U> -> ('T -> 'U)
#endif There does indeed need to be some kind of replacement for this overload using |
@dsyme Yes, I noticed that. But there exists another version that uses |
@ruxo Yes, you are correct that the Func version is not revealed in the signature. It should be |
@KevinRansom @cartermp My original proposed solution for this was to add Func-based overloads to the ToFSharpFunc API. It would be a nice addition however it's a breaking change for C# callers. The approach I recommend is to keep the FuncConvert API the same as it has always been and to have a .NET Standard 2.0 build of FSharp.Core (where System.Converter is available). I’ve forgotten – where are we on a .NET Standard 2.0 build of FSharp.Core? |
This is causing problems in practice, see #4470 @KevinRansom again mentioning that this strongly motivates having a .NET Standard 2.0-specific cut of FSharp.Core. |
@KevinRansom @dsyme let's pull the trigger on dropping We should also look at #6128 to see if it's related. |
so what is the status of this? |
Nice, thank you @cartermp! |
Hi,
I have an issue with using
FuncConvert.ToFSharpFunc
. For example:This will cause following compilation error:
error FS0502: The member or object constructor 'ToFSharpFunc' takes 1 type argument(s) but is here given 2. The required signature is 'static member FuncConvert.ToFSharpFunc : action:Action<'T> -> ('T -> unit)'
.NET CLI: 1.0.0-preview2-1-003177
Compiler Version: dotnet-compile-fsc/1.0.0-preview2-020000
dotNET Core Version: 1.1.0
The text was updated successfully, but these errors were encountered: