immutable-collections Questions

8

Solved

Is there any way (possibly a dirty hack) to create an ImmutableArray which will just use a specified array, instead of copying it over? I have an array which I know won't change, and I want to crea...
Slocum asked 12/7, 2018 at 7:49

4

Solved

Recently read about immutable collections. They are recommended to be used as a thread safe for reading, when the read operations are performed more often than write. Then I want to test read perfo...

6

Solved

.NET 4.5 has a new namespace System.Collections.Immutable This package provides collections that are thread safe and guaranteed to never change their contents, also known as immutable collection...
Laudation asked 11/5, 2015 at 10:52

5

Solved

In C#, what is the key difference (in terms of features or use cases) between these two containers? There doesn't appear to be any information comparing these on Google. System.Collections.ObjectMo...
Rosabelle asked 24/10, 2017 at 12:57

2

I have a confusing issue with Nuget. I have a number of projects who claim to have System.Collections.Immutable installed at version 1.3.0 but if I look at the version of the dll in all the referen...
Marjoriemarjory asked 20/12, 2016 at 14:3

1

I was reading about C#'s ImmutableSortedDictionary in System.Collections.Immutable and thinking about how to apply it in my program. I quite like C++'s lower_bound and upper_bound (see here), and I...
Vedic asked 7/11, 2019 at 5:32

3

Solved

I'm trying to initialize an immutable list like a regular list, but it's telling me it doesn't take 0 arguments. It throws the same error if I pass 1 argument, 2 arguments, etc. public static read...
Stepdame asked 12/6, 2018 at 15:6

1

Solved

I feel a little stupid for asking this, but I'm currently learning functional programming and completed an exercise on creating singly linked lists and it just got me thinking, is it even possible ...

2

Before immutability, IEnumerable was the go-to interface in many APIs since this had the advantage that the API was insensitive to the actual type of the passed object. public void DoSomeEnumerati...
Melodeemelodeon asked 16/5, 2015 at 10:24

1

Solved

C#: In C# I have something like this: IImmutableDictionary<string, string> map = new Dictionary<string, string> { {"K1", "V1"}, {"K2", "V2"}, {"K3", "V3"}, }.ToImmutableDictionary(...
Emery asked 26/1, 2018 at 10:33

3

Solved

Use case: Process list of string via method which returns ImmutableTable of type {R,C,V}. For instance ImmutableTable of {Integer,String,Boolean} process(String item){...} Collect the result i.e, ...
Overbuild asked 16/8, 2016 at 22:51

3

Solved

I currently get returned an ImmutableSet from a function call (getFeatures()) and due to the structure of the rest of my code to be executed later on- it would be much easier to change this to a Li...
Procedure asked 10/6, 2015 at 15:56

1

I have a tree structure data like this: [{ id: 54, name:123, children: [{ id: 54, name:123, children: [{ id: 154, name:1234, children []... }] }] }, { ... }] I am using Angular 2. As...
Autunite asked 23/12, 2016 at 9:22

9

Solved

Let's say I'm writing a method that should return a Map. For instance: public Map<String, Integer> foo() { return new HashMap<String, Integer>(); } After thinking about it for a whi...
Euphorbia asked 28/6, 2016 at 23:30

1

I think a new ImmutableList of N+1 items is created. Thus its complexity should be O(N).
Mastoiditis asked 18/5, 2016 at 15:37

1

Solved

I need to create a field for simple game. In first version the field was like Point[,] - two dimensional array. Now i need use System.Collections.Immutable (it's important condition). I trying to ...
Abib asked 19/9, 2015 at 14:4

3

Solved

I'm trying using ReadOnlyCollection to make object immutable, I want the property of object are immutable. public ReadOnlyCollection<FooObject> MyReadOnlyList { get { return new ReadOnly...
Consubstantial asked 7/9, 2015 at 12:39

1

Solved

I just switched from (an older) Microsoft.Bcl.Immutable NuGet package to System.Collections.Immutable and was surprised to find all these new package dependencies in my project: System.Collections...
Transit asked 24/8, 2015 at 16:17

2

Solved

I have a list (to be precise ImmutableHashSet<ListItem> from System.Collections.Immutable) of base items and try to call the following code _baseList.Contains(derivedItem) but this returns...
Enloe asked 4/6, 2015 at 13:17

3

I have heard that the .NET System.Collections.Immutable collections are implemented as balanced binary trees in order to satisfy their immutability constraints, even collections which traditionally...
Acriflavine asked 8/4, 2015 at 18:38

2

Solved

Why does ImmutableArray seem to not be there in Microsoft Immutable Collections NuGet package version 1.0.34?
Walkon asked 26/3, 2015 at 7:57

1

Solved

I have a piece of code that iterates over a small list frequently. Given that the list never changes during runtime, I replaced the implementation with ImmutableList<T>. Looking at a performa...
Alfie asked 20/2, 2015 at 4:1

4

Solved

What is difference between ImmutableArray<T> and ImmutableList<T>, and where would it be best to use each?
Verla asked 12/3, 2014 at 11:18
1

© 2022 - 2025 — McMap. All rights reserved.