• Supported return types:
◦ Collections: ..., List<T>, ...
◦ Note: Arrays are not allowed as return types because they are mutable. Use IReadOnlyList<T> instead.
I don't understand. Why is List<T> allowed then if it's mutable?
Array also implements IReadOnlyList if I'm not mistaken.
I think C# doesn't really have immutable collections, they just can be typecasted to IReadonly* to hide the mutable operations. But they can always be typecasted back to their mutable base implementation.
The only real immutable collections I know of, are F#s linked lists.
Isn't Frozen something you do to a set or dictionary to say, I'm not going to add any more values, please give me a version of this which is optimized for lookup only?
I think C# doesn't really have immutable collections, they just can be typecasted to IReadonly* to hide the mutable operations. But they can always be typecasted back to their mutable base implementation.
The only real immutable collections I know of, are F#s linked lists.