Has anyone succeeded in opening the pre-release System.Collections.Immutable
from NuGet in F#?
I'm getting this error:
The type 'IEnumerable`1' is required here and is unavailable. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Even though my project is .NET 4.5
Tried explicitly opening System.Runtime and that did not work either. I am referencing .NETCore\v4.5\System.Runtime.dll
The collections returned by the convenience factory methods added in JDK 9 are conventionally immutable. Any attempt to add, set, or remove elements from these collections causes an UnsupportedOperationException to be thrown.
4. Kotlin Collections. In Kotlin, all non-mutable collections, such as List, are compile-time read-only by default, and not immutable. While the defined interfaces do not support methods to change data within the collection, the underlying data can still be changed.
NuGet Package System. Collections. Immutable. This package provides collections that are thread safe and guaranteed to never change their contents, also known as immutable collections. Like strings, any methods that perform modifications will not change the existing instance but instead return a new instance.
Generally, when an instance of a type is described to be immutable, it means that its value never changes. Immutability, like many things in software engineering, is a design choice. You don't really have to use it, but in some scenarios, you can benefit from it in terms of code performance or understandability.
This is a known issue that the relevant teams at Microsoft are investigating. In the meantime, here are the workaround steps:
Install-Package Microsoft.Bcl.Immutable -pre
After that, early testing suggests F# works with the immutable collections just fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With