ImmutableList is implemented as a tree which is confusing. Judging by its name, the user of this class likely expects performance characteristics similar to a List. Anecdotally we regularly find instances in our project's code where someone unintentionally used an ImmutableList instead of an ImmutableArray.
The proposed solution is to add a FrozenList class, complementing the existing FrozenDictionary and FrozenSet classes, backed by an array and with the same computational complexity as List.
In addition to the above consider renaming ImmutableList to ImmutableTreeList but that would break backward compatibility.
ImmutableListis implemented as a tree which is confusing. Judging by its name, the user of this class likely expects performance characteristics similar to aList. Anecdotally we regularly find instances in our project's code where someone unintentionally used anImmutableListinstead of anImmutableArray.The proposed solution is to add a
FrozenListclass, complementing the existingFrozenDictionaryandFrozenSetclasses, backed by an array and with the same computational complexity asList.In addition to the above consider renaming
ImmutableListtoImmutableTreeListbut that would break backward compatibility.