When an element is moved in the source collection of a sorted view, the change might result in a move in the sorted representation.
For example, if we sort Seq("Dog", "Cat", "Giraffe" "Mouse") by name we end up with:
if we now apply an Update(2, "Zebra") to the source, we would end up with:
- Cat
- Dog
- Mouse
- Zebra
where 2 and 3 switched places, but we could also say that 2 was removed and then there was a new insertion at index 3
So, which will it be?
When an element is moved in the source collection of a sorted view, the change might result in a move in the sorted representation.
For example, if we sort
Seq("Dog", "Cat", "Giraffe" "Mouse")by name we end up with:if we now apply an
Update(2, "Zebra")to the source, we would end up with:where
2and3switched places, but we could also say that2was removed and then there was a new insertion at index3So, which will it be?