and no one bats an eye but should I only add a word “monad” and everyone is too scared because it’s so difficult?” – Conclusions on the speaker dinner/Joker 2021 Motivation
= Arrays.asList(1, 2, 3); We can’t reassign it like list = Arrays.asList(1, 2, 6); But can alter the list itself e.g. with set(0, 10) We can wrap with unmodifiableList or use List.of to begin with, but we don’t know by type whether provided list is mutable (ArrayList), semi-mutable (Arrays.asList) or unmodifiable. Also deep structures are not covered.
modify but somebody else might be able to. MutableCollection, MutableList, etc - you can modify this ImmutableList (from kotlinx.collections.immutable) - nobody can modify collection/list