The partition implementation was swapping the values rather than calling through to OrderedArray's partition. This led to the invariant of the key equaling the id of the value being broken.
The test only uses two elements since I think partition is unstable and so using more elements would make checking equality of the collections more complex.
The partition implementation was swapping the values rather than calling through to OrderedArray's partition. This led to the invariant of the key equaling the id of the value being broken.
The test only uses two elements since I think partition is unstable and so using more elements would make checking equality of the collections more complex.