Closed rgrempel closed 8 years ago
That doesn't seem consistent with the docs. I think it is a bug, and the return value should be [0,1,24,3]
— is that what you were expecting, too?
Given that the implementation is just replace x = adjust (const x)
, I think adjust
might be broken in the same way.
Yes, that's what I expected as well.
As for the docs, I suppose it does "replace" the element in a way (in that it deletes the right element) -- I was just expecting it to replace it at the same position. :-)
Given that an explicit order is one of the defining features of sequences, I think this is definitely wrong.
Should be fixed in 0.4.3. Thanks for reporting! :)
Yes, I've tested 0.4.3 in my app, and it works as expected now.
Thanks -- that was fast!
I was a bit surprised by the behaviour of
Data.Sequence.replace
... consider this:It looks like
replace
removes the element specified by the index, but adds the new element at the beginning ... that is, when adding the new element, it ignores the index and just adds it at the start.Is this a bug or a feature?
For my own purposes, I do need to work around it.