Looking at this question, where the questioner is interested in the first and last instances of some element in a List
, it seems a more efficient solution would be
Because you would have to copy the whole list each time you want to make a change. With a normal linked list, you can at least prepend to the list without having to copy everything. And if you do want to copy everything on every change, you don't need a linked list for that. You can just use an immutable array.