fslaborg / Deedle

Easy to use .NET library for data and time series manipulation and for scientific programming
http://fslab.org/Deedle/
BSD 2-Clause "Simplified" License
924 stars 196 forks source link

Deedle's FSharp.Data types conflict with FSharp.Data's FSharp.Data types #465

Closed nightroman closed 5 years ago

nightroman commented 5 years ago

_190407_055755_deedle.zip

I have a project using both FSharp.Data and Deedle. Both these packages have types FSharp.Data.*. This fact causes problems, sometimes resolvable, sometimes not. Problems may depend on the order of references, order of code, compiler vs. scripted, etc.

My real problem case with "not resolvable" problems is difficult to present. I provide a somewhat similar "resolvable" problem in the attached scripted project. It is "resolvable" because I can change the order of #r directives in the script in order to avoid the conflict. In my real case references are added elsewhere, I cannot control this, the problem is fatal.

See the attached zip. Unpack it and open the directory in Visual Studio Code. Open the script Test1.fsx, note compiler errors:

error FS0001: The type 'FSharp.Data.CsvRow (Deedle, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)'
is not compatible with the type 'FSharp.Data.CsvRow (FSharp.Data, Version=3.0.1.0, Culture=neutral, PublicKeyToken=null)'

Change the order of #r statements in the script, the errors are gone. Like I said, this is not a solution in my real case.

I do not know why Deedle uses names FSharp.Data.* instead of some Deedle.*. Probably there were some reasons for this design decision. This makes issues... Any suggestions on how to deal with these conflicts?

zyzhu commented 5 years ago

It might be related to the FSharp.Data signature files that I disabled when I migrated library to netstandard. Will look into it.

zyzhu commented 5 years ago

@nightroman I've added back signature files to control access of fsharp.data implementation details. https://github.com/fslaborg/Deedle/pull/466

It didn't show conflict anymore on my local test.

I've published 2.0.2 on nuget. Please test it and let me know.

nightroman commented 5 years ago

The problem is solved. Thank you very much for your help!