fsharp / fsharp.github.io

F# Core Engineering Group
http://fsharp.github.io
45 stars 53 forks source link

Add info on FSharp.Core and type providers #22

Closed dsyme closed 5 years ago

dsyme commented 9 years ago

We should add info on FSharp.Core and type providers here:

http://fsharp.github.io/2015/04/18/fsharp-core-notes.html

or as a separate post

dsyme commented 9 years ago

cc @ovatsus

ovatsus commented 9 years ago

To be honest, at this point I don't event really know what works best in terms of FSharp.Core and type providers. For the designtime assembly, whatever FSharp.Core you reference doesn't matter, because the version already loaded by the compiler will override it. So if you are using FSharp.Core 4.3.0.0 and the consumer of the TP library is using VS2013, or if you're using FSharp.Core 4.3.1.0.0 and the consumer of the TP library is using VS2015, everything is already messed up if you use F# types on the interface with the runtime library (like option types or lists), you will be referencing both and have type mismatches. Sometimes assembly redirects fix this, sometimes they don't, I haven't really understood on what circumstances they help or not, or why. That's why around the time VS2013 was released F# Data switched from doing that assembly replacer hack only for portable profiles to doing it all the time, to workaround this issue. And for some F# types, like functions, not even with that you're able to make it work, that's why it uses delegates in a lot of places. For reference see:

ovatsus commented 9 years ago

BTW, the idea of having a separate tool that would do reference fix ups I mentioned yesterday won't work, as that would have to be done for all consumers of the TP library, not for the TP library itself :/

ovatsus commented 9 years ago

Another thing I just remembered, is that while references to FSharp.Core 4.3.0.0 don't happily convert to FSharp.Core 4.3.1.0 references and vice versa, that works fine between FSharp.Core 2.3.5.0 and FSharp.Core 2.3.5.1, I think they have some kind of IsRetargetable property on their strong name, don't quite remember the details