dotnet-bot on feature
dotnet-bot on feature
dotnet-bot on main-to-release
dotnet-bot on main-to-release
dotnet-bot on main-to-release
dotnet-bot on main-to-release
dotnet-bot on release
dotnet-bot on release
dotnet-bot on release
dotnet-bot on release
dotnet-bot on release
dotnet-bot on release
dotnet-bot on release
dotnet-bot on release
dotnet-bot on dev16.0-to-main
dotnet-bot on dev16.0-to-main
dotnet-bot on feature
dotnet-bot on feature
dotnet-bot on main-to-release
netcoreapp2.0
. And it seems the library (Argu in this case) doesn't have a .dll for that.
netcoreapp2.0
? Can't find in here: https://github.com/dotnet/standard/blob/master/docs/versions.md
2.0.0-preview1
doesnt work with F# (more info in https://github.com/dotnet/netcorecli-fsc/wiki/.NET-Core-SDK-2.0.0-preview1 )
2.0.0-preview2
netcoreapp2.0
can reference libraries up to netstandard2.0
, so can use Argu, who support netstandard1.6
netcoreapp
is the targe framework for console app (to be precise, is the .net core tfm). libraries usually target netstandard so can be used by both .net fw (like net45
) and .net core (netcoreapp
)
Hey folks,
I have a question about async workflows in .NET Core 2.0:
In one of my projects I had this line in the code:
async {
...
do! tran.CommitAsync()
}
Where CommitAsync()
returns a Task
. After upgrading to .NET Core 2.0, it gives a build error saying This expression was expected to have type 'Async<unit>'
, and I have to change it to this to make it compile:
async {
...
do! tran.CommitAsync() |> Async.AwaitIAsyncResult |> Async.Ignore
}
Do you know what's the reason for this? Was something changed in the compiler?
Task
to Async<unit>
(and from Task<T>
to Async<T>
), and when the FSharp.NET.Sdk package was removed from the project file, you no longer had those implicit casts available so you had to convert from Task
to Async<unit>
manually.
type IInterface<'T when 'T :> IInterface<'T>> =
abstract member Property : ICollection<IInterface<'T>>
type Implementor() =
interface IInterface<Implementor> with
member Property = List<Implementor>() :> ICollection<IInterface<Drop>>
Is there a reason why it is not possible to implement generic methods on a interface implementation?
type IMap =
abstract member Map: 'a -> 'b
type MapIntString() =
interface IMap with
member this.Map(x:int): string = sprintf "%i" x
type MapStringToInt() =
interface IMap with
member this.Map(x:string): int = 0
I know I can
type IMap<'a, 'b> =
abstract member Map: 'a -> 'b
type MapIntString() =
interface IMap<int, string> with
member this.Map x = sprintf "%i" x
type MapStringToInt() =
interface Map<string, int> with
member this.Map (x:string): int = 0
But that is not always possible or leads enormous amounts of code.
for example
type MapFoo(f: 'a -> 'b) =
interface Map with
member this.Map (x:Foo<'a>): Foo<'b> =
let (Foo a) = x
Foo (f a)
In the above example at the moment I would have to create a specialized impl for any combination of 'a
and 'b
of Foo<_>
whereas with an implementation like MapFoo
I just need the functions that do the conversion and give one of these functions during construction time
So my question is: are there any hard technical limitations (CLR/.NET) or type theory or type inferrence that prevents this? And if so why is it even possible to define the interface like
type IMap =
abstract member Map: 'a -> 'b
Why not have a compiler error when trying to define a generic abstract method that uses generic types that are not defined on the type itself?